doxia-sitetools-1.1.4/0000755000175000017500000000000011633153574014612 5ustar twernertwernerdoxia-sitetools-1.1.4/src/0000755000175000017500000000000011633153572015377 5ustar twernertwernerdoxia-sitetools-1.1.4/src/site/0000755000175000017500000000000011633153572016343 5ustar twernertwernerdoxia-sitetools-1.1.4/src/site/resources/0000755000175000017500000000000011633153572020355 5ustar twernertwernerdoxia-sitetools-1.1.4/src/site/resources/images/0000755000175000017500000000000011633153572021622 5ustar twernertwernerdoxia-sitetools-1.1.4/src/site/resources/images/doxia-sitetools-deps.png0000644000175000017500000002620411150346601026403 0ustar twernertwernerPNG  IHDR#3ysRGBbKGDC pHYsGltIME$%DG IDATxy\TYJrݮfv53׺]sK 4%wZYjE.-MKoYiijj;vCEL 8~>=3|33L&e`('d2T 1A@e9WcY?HĿ2X4&h\〓\DDDA,"" XDDD""" [rҝHeTq>Zce9Qk_pxьXDDD3r̔eS.J&u_=3$k)Wjر+;G:WpqudoeX: ӆKClv$ &kT.nxr;yT_RB</zv`،؛BQ~:;ּbۨ)WgѾt&-Qٹm'[7B4e0KgPpd4WsH-:ڦ㼿'nm+(X@*\yV` ص/N'Gibٵ;64-NF`Uz3lŭl{=hJuAtbv}+~3t"Wcw6D[6,0֝1ҤM-C!F~'gG7Ϫ \Fp6(X@roG¿HlY F{ڵ:V`_;mxޕ}O3S&^zgOФug~i߹Q)N?e]7m%zݲ^?|­7n>mџ4hF\u3y1b >_~ Re2ezDm]\6 Yv|gKm)VML+mP/pDxqY?Cܑ9g|-6,Hؼz>\< sUۡXۮȏ185/9.β)PO4yɟBm=[;=Oj!>v̛7HJ&^>vǾX;ǟpFq1}.βq[Cۿ ^Qy#_ͬ5۪K?63K񧹞yc`4h<(2C[e -W{663f<N/~Λ9[Hܑw,϶\=:y j51xR͈ЌX4&f""" QXDDDA,""" b(EDDʻ2G_!2e:+c2 H Z&QEP:U'x@A,% E*x@V:[Q:Y:H b)oQBYQr dB!E*x@VK)-duJ J*pe+E*ŸYAWFyH bu2ʚ%T@ V+'duPƂgt! V+E4> : ̒pe\D㕧+y Ӏ%D dG zNWr\زSً¸=!Y]t–:ט`KR;>է+ap%7KM&!{}u\)1Aӕ(m apeu\)1!wXP>mC{5L4*O 6Z#DŽ:TɐʽqE~iϳ|u^q䅹JtꠂqE/ p)3b{ޘUѮL ~DRRii\BQ?u>"r0~˖jRdjGOXد|z*ۇQ'"RٳggFt89p=X}I@8yw^MgڴM<>>3 sJ oqi{:'n$115Ϻg\fĈqKu٬Yn~=3_Bhen̴1i$\Vl9fd>zqԮ=3 !?TyZ&0bJ UI:u&1Csj8o `Ȑ1-u byrrÇZLԌ|ۑ[m쵝u`ٞ2SQTxo~l3 G͈ҳg3BBo_,;ZܶjNӦuIKˠgDF2sTsl#""oS޿J.8ryӗXp';we)TŋItųs 739۞S͚B/xk6nhk0ztAd):uC^&#c 11ڵ);weŊV?o79r_:M%=}S":snX…D:tHN~o-϶s>?0?OЛU,3}/:#"8|RS?`gg'MJꣷu;;Mt{$: ۞r^p^=4Z`ժԪiwY\>/ M؎Zj;eWU'[{[c˘q؂xygu>4olI5ͳ ֯ma4:ѢE=ViܹmWW#]41XC (h~~uZՍeˆa2sk6WFgٶg횽{OR;=zSxѢnwwƏ Ҭٝxx0yr,{ϳ}j{w?,s(l{ʩW{0Av>N׮okq^|{7ϳ%ChѢU1s棷n%kyݶSԱJTzT3f]orqqfԨ.6nl϶m?pW_}1+O.[]4XޭYN]E.^z>7#b۶n[\8gUֲJBE{:wnb^~;[ړ3Py;K;qkݺŅ@fX[mlU'P*~3J4suWN¶ Zd{y +;﬎w~Ɨ_fߖnMybuik]d{.`r~æs(l{*f,V)?mޱSaꪸɑ182t2#Ol3֭Q߆ jZ/۾:;OhIzhIv5jT''*,; &OÒ% cpr2Я_+*+[ϯ.11ٳ}4L&ҨQã;#\aSn3fl&:;qL "j;uRWSQ=ԘQܸ%--&l?!Csin$>>ɓ?`WV;`@[_˾}dd$,W>3C7p%RR3vz ^)y^_&wW֭ҥktK:U+`jk] NssDDb{uVCv-MRSH1.]wwB 9Vٴv$u,T*zOُ-cC]2n{:]iӺ?>bڞر>3xǙ6o!*T{dmY~WEz :wV?1{,۷cB9'ڞsJ [&11ÇgE\\m̦zugRec[/o:_vUߦĞʶ1]uT)+m'[u̸]ҏ ;;;]o]%usF ¦2~x{{a4:Qv hKx| fMO¦2vlO4DÆ7AçY4ξ}xԬ鉫՛6Sht"==īW0ᢰ.܌5ѣ{pps32p`<͝?IFW]xV,_>ܦc)l{6f:ΜLP`6/seƌYgWܮUv+S=S[cᨱP3/xE4kv'ǎ.䬣l̈)^*_?6뻦!+ ]_0iR1P8۶mdc8аa-<<\ׯ[>ob͈K3sU""XDDD"""E )~bR =l׫c<񾾞&XDDDA,""" b(ED*~}8]ˬ,XDD T"RG3bH;FMNxxСyݖLϤqzݑgY;d Y_]n3C}>֞_ҫ׿Y^Ǎ{Xs/HPvsf|4 J&Ԫu/#Fض-gOM{_qs>̙oӬYWܼV͏Ν]ekZ4,?C| 6-{p<_4݁kDE}G 8}[?Hժۏ8({,yyV駟䣏޷){n˖xmʅ,^bȑOrBϞ2}sy8ݍ;>`ʔyVcW8Ѷj)%3g#6MWbMDEX/0M97aa[IO?Eh||}7pr2z{$%%3|1dVzgŋ$%%8>kVuvSD!gO`̘8;;sLx՗,mSfEyNs22N]c3 ב~,^uAA+4#֌XDʺVz }^wOgi-Z){w3y{oSc^Kǂ_ ?q DF槟b:BH^bb~`0y޽_3KG,l-̈۴yƆsݍkM>@ٵ36lϹsӃ׻ XDJIIݼkTgIKKϳ^jjsu^DGE{M]ksE{lDY=Μ{ym^(p_֖s~YQӗԴ|v$$O0j󺞞cƌqe`KִH)Ȟ X]/L[.o /́Q4mK/rBbbv ]eOit<+d 'Xb!]t$%%Ԯ}/K~dW(EDJ/{[,?`s?4XK>Jǎm fx|aa[y睙T3Q9?[ ?72''{qqVƍ39.y晧 BDLXR8vd 4t ڵ"8xb!e*{=#)%&#/\8?-XC;;4 HÆ7Y7԰asy^7^iDP={aÞzWSOJOݸv|RfűgO-]:ѣGU ww7y˗/^gH50/_Ү][Y|ww7h^M+5#֌XDDxHR(EDD""" QXDDDA,"""D_Q+/P鈈T,FAa-E*˅HE[hpR)BXD3b)UBXD3b)C4@BXDA, YXDDDA,1h6, V؊(EĢQ(ED!, ~E" bBXDA,"Qk,QY" H+&O*e@!,R˟A TKOEDa(E"" a(E"" a(E%ο|/*dVrS(N_C۫ D!,"2[.BXD4#He'%ijy h γ^zUZ:vlQN={d(\\-ֽ| /~~MD>'s$_e8xjԩG^^ţj z#_Z=m4]sAPN=mƼgUgΞ cDqD~ ̓O7*-m,jFzK\KL`[g+FWZw)AWnWW($% ob"#ZzӘГSG".bۊ95Ot7Gt" uϝfd޼$j"݅ G\?u 9)+Y6.HJejm%-ֹO'%2Ȯ,@ IDATZbRRL7}76WF޸#?G8991Օvgqԯh6,Rc;q.2}~KgҲݜ=e:ݭ:C,ٟ 14mە; ߬Gnс6=t{?l[F:B4e0KgPpd4Ws|[7Qw2m1MaQX/@[v#M>nk *#xea>Kl3?;{SxW8gY+ asƧ}]\kߝӗXw`FH= _5&QnUHm>[5,0֝1ҤM-C!ka,n'?fӢ#}ߛƚgv4hJy{%]k-_k\\ypiz*Cgsw3\6y 8fbqGBX"*g`ND |C8} 7ogMƿ Ri~X;xq?m725* uGo?H5>N4N;򗇚_OIl1[xxs1{8W":-3әLЗI}$f~guS~ǓrkF]qԯ=白E!,q>nLZOZ;0ᡁ 5"ǫ7NFTMۿ `ڪp P.G>OY&FW6ҩ0].rQHOE\Qhv."e@DDDA,"" Hc0" QXDDDA,Re?MMgVS Ԯ=^ իL _@ܞga^gȐ1Y&w׭`geǑe41s4k67VE:w~? Ue8SI|FvȍՅ+Z/SycJKˠ[G8p ww)LA) ){n-FFM~0xpG?x; Yq#$&O ^-r kצ;xBBש[~ʵkĜgI@ ,Mrrm4MFꯢ=#ٰKq.MػW:t&Ymbb*?clӕ)k׈+WRhz6>ӦeꑪH͈E猸$UqF3b͈EDD""" )EHٰhF,"" XDDDl/ٰ 52L_!~Y?@-IENDB`doxia-sitetools-1.1.4/src/site/xdoc/0000755000175000017500000000000011633153572017300 5ustar twernertwernerdoxia-sitetools-1.1.4/src/site/xdoc/index.xml0000644000175000017500000000515011401010057021111 0ustar twernertwerner Doxia Sitetools Hervé Boutemy

Doxia Sitetools generates sites, consisting of static and dynamic content that was generated by Doxia.

doxia-sitetools-1.1.4/src/site/xdoc/doxia-sitetools-deps.odg0000644000175000017500000002610211401010025024026 0ustar twernertwernerPKU:.++mimetypeapplication/vnd.oasis.opendocument.graphicsPKU:Configurations2/statusbar/PKU:'Configurations2/accelerator/current.xmlPKPKU:Configurations2/floater/PKU:Configurations2/popupmenu/PKU:Configurations2/progressbar/PKU:Configurations2/menubar/PKU:Configurations2/toolbar/PKU:Configurations2/images/Bitmaps/PKU: content.xml[Ko6W*zԃz2,COIQ [eHͮ$ ?c_I9zRӍlك3f.M e\Gk$XL\Tp[,hDf1)J#bY)5zvy6c,))fe4c9Z,=֪Gr(W²vIv2tʕsUUY`ʻ"1L渤%4M=x5"bjuY*GfyhrUPqcPqcY7֭>noZ ;*4Wf--3:SA&{ec۞Uo9- ģG#D,=C0B#QPpz.Ⓩ.ZAYLD BD*PgAInx ,^|&=~b,U_d`OdTsDs=Α ,b/lkxIt.9W4js̡U?Z <cs#&D8` ~D*a"9~a9h)!(Vbul_l.t.WC B6Rlk(N +6K1g\%]8N.حM1L!9OI"iwЋ[CiM7JMD**u3Sh@0o4OOGC{y:=D+QḰ:ٷj&Y~4 mZ7j[3ҵt5MB&V3w_+H\Yj+'Uz<Å\q{NZ⋭vYf̉뵃5;k)8˛h-"Fyqݹَb#eZ`ܸ[ $[A_56ʈ %۟0lA|R: nY3>&r ,BgF^5o5XYz`/U0xTɎNLv6Tr/990t7+ &ɷieb%Ə=fc%Ɓz'"kO:;$ϭ]Wh0L^,lˉPM'ȷ5W!͙L.zZF (%8JA͕c#3 'y e}")z;O  Ђ=!"C qT^0Bd3[y ԕw _PA!-z/WCB 9ʏ|2 HAK^AJBK4 Os2ZWKH9 x`xP;hs.~RC"Hs0|;|f?鴨[nU>vrX0Q"F{ jA11*B&zf,طK;UiY/o_O@>׏5}}@CSr oһ Te) *$x)Y U"PK P['3PKU: styles.xml\͎6)֏bqEOMQ$i-Q6I(jKtHJ2eK^9f7 @sfę󣙥ū$n)KW7rm iY W/xdHH*P.1-N&삧Ks/S|)%HZ -MJW̦ mu)r+,ySSRĐY`j=oYtPܚ/tIDaSls4YCs?K>`:&3N!pEkSگ ٖvśa8 ʘ&p!XaYhHfqvɖi urh䕝$IEKК I9Hocĺ"E *MC"DX*sRleY8fҮk H!!yb)[,֨B'쬷,^lXц _\582*f7SYN[3O2bn oo۶pi#4SJ2$VTbЪ>Pj_>VҎi'KL -x΀ӄۈՌbHMS\/!H.pbwntd 'PIct]Lm:PkXPz{F\Rۄ#ǵJbQ á|5Grϟ= š !+_-&AѸnq3 !!5Tt4Iܷ+W4of#0b(ܱfF"4QCٴGMBEle?vW67a$;dAh#a$;da$;dH93@ٝPa i_9\WJ󮎫&hs#鈦S^}ÿ89i{8( ⛞=f4C OpenOffice.org/2.4$Linux OpenOffice.org_project/680m17$Build-93102008-12-20T23:12:092009-02-21T22:30:5617PT6H39M4SPKU:Thumbnails/thumbnail.pngWQ;er=WY Y0I6)(:c%冦B(" R: )dɦ"&XOaYbj_Y> Ay`R\p5S÷!g/m y{8c KCz{8[\ O;&ÝP"nTH"SHB3B8}tGǵGgGG $ܘ;D[;DziE b~tAG˼(/z{ az1=ai"|;nYޞ<viȍ!dIor311"7q='\VxPQd oߣ̀qhJz-r-TZ1&ؑ*;%Z'IxҾzd|S$ p%~xV7ћ>[Nn3o :.9V LV}OK'ĠΡ>IXII~{L]g3d0r=I/v:9=+f6Eu=л7i^_S5WP)37@4odBZr/Az~#$iv{ԴH8q~ {Qgǵ/ڱ2vDK`Dj"/vOUt(  eӗcka)&=r̉ea?5کv3h0N(D?q(h{.=z z p?1P u1y7Lmwk۝rnoNX M"uU H nކByc SKd2PgQ}iyuV\װ%zG4'm㚦 ?P\](1ӣYӃx&VM1v"'C.wizl4(L?|xqS|hf2NSgr8G  qN "z94WacClF&PV,f]b=qh8Urԑߘo\b]^䯃],NJF?!,E$QEt&>uSru$VV2w+4 QAECBARQ=q$bN,1sA dRFkc;fNDOK;]˩կ=3C9c` m~ҋ$j֝Kga҅Cjwvoۀdڻ*0M^hn)?bk\ՠݡ'XMn^ſ}{5Ee5V6iç}(syր\_PTŇ)M` I\9%VU}FI6Ftd+Փ[)֯$c4{č(a kS["^NhtH0\R迱EͯnL4Y`*f7 ћ_\|'CcFp9Q؝V{7 pZ!ըnCbs/G3:4l]s.rˆlA#D-2#w|nw@ . KQ%$%mS8%3Mb kiG[A )rH_ ̙zڛ9seʪxOW:zZ)kLp;6%.=[qYruR&@_ݰht/PyD I a}`O3[e5 iu ^S<_%$ʺNbH6^--9Iŏ:vQc(J=pcU`5'yՏU8捛lDLMDsb:VCڨC'PKs PKU: settings.xmlZms6_C;50 GK.& "KIƐ__qKz]jwp§'spvcNm1ak4l\gAs/􁩂y3YY X`$|Uxl=,(a/7LR,FQtr1-r1L H T"qki=ΞXB V%Eq}3[-x^!Fca[Z7~%Ƥ뵢Q>Y?n,zeN Vں׌q!͠Zz0eU guqRKyf, |ut*YsXaw J7WF{X#1D#TBU=dmApGc~9Ĭ!do v;rP01I~}4;$H.apQ x%Y\|P")HFhf"Kv!t=lshR9]&ӥEҥ}tPf+EKv5-XZѯ3Y:@*o˽oR|$xS/bvgwC "t: P ܑ+qVtdLq2ࡶae $gM;E ( \0m (qEA>,u& N }Hq#GOt ~1=:2c& ƒ7,YDP?qb)12<;^2'HPǷVB_9A@# zҢFVt[}MP,~*ČUW2jRԹIPSkaƚyf $gƜؐQHtvi&45E3șix9 ¼ L5_(0A y/yJ9rn&$:J[D# n Ɛ\ G˫0 |iHr?)76'a.s ^a7 x#D  w}AyēCD, DGo:'vr3&ʣl8 c53Q K=V RN4ns|ӫ崞Fer8Lv~8:-åS5v/qPcu7ڔzfvN}E݆#l1|z.;zgOQy{Ў괦u'̥tg8jӸ?0lm/xk'V\%7x`]B$dqC PK3]6A#PKU:META-INF/manifest.xmlKj0@=VU1q-&fW6X; HFi[S0Oͣ)k7vc^aaӠNZu`ZVzEdZ>T yb`yʝ뛣V4cՊą0$c.mʛwS<&Bϒ8b<(sT)i]EX|H!_Tʝz18{oIjN7IQׂpqr՛5\AkagMv@|6s-,2O\څ'.?PKANPKU:.++mimetypePKU:QConfigurations2/statusbar/PKU:'Configurations2/accelerator/current.xmlPKU:Configurations2/floater/PKU:Configurations2/popupmenu/PKU:NConfigurations2/progressbar/PKU:Configurations2/menubar/PKU:Configurations2/toolbar/PKU:Configurations2/images/Bitmaps/PKU: P['3 1content.xmlPKU:ZrE } styles.xmlPKU::iOOmeta.xmlPKU:s ;Thumbnails/thumbnail.pngPKU:3]6A# settings.xmlPKU:AN&META-INF/manifest.xmlPK>(doxia-sitetools-1.1.4/src/site/site.xml0000644000175000017500000000276111371561527020041 0ustar twernertwerner Doxia images/apache-maven-project-2.png images/maven-logo-2.gif doxia-sitetools-1.1.4/doxia-doc-renderer/0000755000175000017500000000000011633153574020265 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/0000755000175000017500000000000011633153574021054 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/0000755000175000017500000000000011633153574022000 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/resources/0000755000175000017500000000000011633153574024012 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/resources/org/0000755000175000017500000000000011633153574024601 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/resources/org/apache/0000755000175000017500000000000011633153574026022 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/resources/org/apache/maven/0000755000175000017500000000000011633153574027130 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/resources/org/apache/maven/doxia/0000755000175000017500000000000011633153574030234 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/resources/org/apache/maven/doxia/docrenderer/0000755000175000017500000000000011633153574032530 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/resources/org/apache/maven/doxia/docrenderer/pdf/0000755000175000017500000000000011633153574033301 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/resources/org/apache/maven/doxia/docrenderer/pdf/itext/doxia-sitetools-1.1.4/doxia-doc-renderer/src/main/resources/org/apache/maven/doxia/docrenderer/pdf/i0000755000175000017500000000000011633153574033452 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/resources/org/apache/maven/doxia/docrenderer/pdf/itext/TOC.xsltdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/resources/org/apache/maven/doxia/docrenderer/pdf/i0000644000175000017500000002326011250471607033452 0ustar twernertwerner
Table Of Contents Table Of Contents
1 1
doxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/0000755000175000017500000000000011633153574022721 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/0000755000175000017500000000000011633153574023510 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/0000755000175000017500000000000011633153574024731 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/0000755000175000017500000000000011633153574026037 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/0000755000175000017500000000000011633153574027143 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/0000755000175000017500000000000011633153574031437 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocRenderer.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocRendere0000644000175000017500000000470511212710455033370 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; /** * Base renderer interface for the document * * @author Vincent Siveton * @version $Id: DocRenderer.java 782358 2009-06-07 10:06:37Z vsiveton $ * @deprecated Since 1.1, use {@link DocumentRenderer} instead. */ public interface DocRenderer { /** Plexus lookup. */ String ROLE = DocRenderer.class.getName(); /** * Render all files from a site directory to an output directory * * @param siteDirectory the input directory contains files to be generated * @param outputDirectory the output directory where files are generated * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any */ void render( File siteDirectory, File outputDirectory ) throws DocumentRendererException, IOException; /** * Render a document depending a context and a document descriptor * * @param siteDirectory the input directory contains files to be generated * @param outputDirectory the output directory where file are generated * @param documentDescriptor the document descriptor * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any */ void render( File siteDirectory, File outputDirectory, File documentDescriptor ) throws DocumentRendererException, IOException; /** * Get the output extension supported * * @return the ouput extension supported */ public String getOutputExtension(); } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDo0000644000175000017500000006312711375511376033422 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.Reader; import java.io.StringReader; import java.io.StringWriter; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; import org.apache.maven.doxia.Doxia; import org.apache.maven.doxia.document.DocumentModel; import org.apache.maven.doxia.document.io.xpp3.DocumentXpp3Reader; import org.apache.maven.doxia.sink.Sink; import org.apache.maven.doxia.parser.ParseException; import org.apache.maven.doxia.parser.Parser; import org.apache.maven.doxia.parser.manager.ParserNotFoundException; import org.apache.maven.doxia.logging.PlexusLoggerWrapper; import org.apache.maven.doxia.module.site.SiteModule; import org.apache.maven.doxia.module.site.manager.SiteModuleManager; import org.apache.maven.doxia.util.XmlValidator; import org.apache.velocity.VelocityContext; import org.apache.velocity.context.Context; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.util.DirectoryScanner; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.xml.XmlStreamReader; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.codehaus.plexus.velocity.SiteResourceLoader; import org.codehaus.plexus.velocity.VelocityComponent; /** * Abstract document renderer. * * @author Vincent Siveton * @author ltheussl * @version $Id: AbstractDocumentRenderer.java 947013 2010-05-21 14:04:46Z ltheussl $ * @since 1.1 */ public abstract class AbstractDocumentRenderer extends AbstractLogEnabled implements DocumentRenderer { /** @plexus.requirement */ protected SiteModuleManager siteModuleManager; /** @plexus.requirement */ protected Doxia doxia; /** @plexus.requirement */ private VelocityComponent velocity; /** * The common base directory of source files. */ private String baseDir; //-------------------------------------------- // //-------------------------------------------- /** * Render an aggregate document from the files found in a Map. * * @param filesToProcess the Map of Files to process. The Map should contain as keys the paths of the * source files (relative to {@link #getBaseDir() baseDir}), and the corresponding SiteModule as values. * @param outputDirectory the output directory where the aggregate document should be generated. * @param documentModel the document model, containing all the metadata, etc. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any * @deprecated since 1.1.2, use {@link #render(Map, File, DocumentModel, DocumentRendererContext)} */ public abstract void render( Map filesToProcess, File outputDirectory, DocumentModel documentModel ) throws DocumentRendererException, IOException; //-------------------------------------------- // //-------------------------------------------- /** {@inheritDoc} */ public void render( Collection files, File outputDirectory, DocumentModel documentModel ) throws DocumentRendererException, IOException { render( getFilesToProcess( files ), outputDirectory, documentModel, null ); } /** {@inheritDoc} */ public void render( File baseDirectory, File outputDirectory, DocumentModel documentModel ) throws DocumentRendererException, IOException { render( baseDirectory, outputDirectory, documentModel, null ); } /** * Render an aggregate document from the files found in a Map. * * @param filesToProcess the Map of Files to process. The Map should contain as keys the paths of the * source files (relative to {@link #getBaseDir() baseDir}), and the corresponding SiteModule as values. * @param outputDirectory the output directory where the aggregate document should be generated. * @param documentModel the document model, containing all the metadata, etc. * @param context the rendering context when processing files. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any */ public void render( Map filesToProcess, File outputDirectory, DocumentModel documentModel, DocumentRendererContext context ) throws DocumentRendererException, IOException { // nop } /** * Render a document from the files found in a source directory, depending on a rendering context. * * @param baseDirectory the directory containing the source files. * This should follow the standard Maven convention, ie containing all the site modules. * @param outputDirectory the output directory where the document should be generated. * @param documentModel the document model, containing all the metadata, etc. * If the model contains a TOC, only the files found in this TOC are rendered, * otherwise all files found under baseDirectory will be processed. * If the model is null, render all files from baseDirectory individually. * @param context the rendering context when processing files. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any * @since 1.1.2 */ public void render( File baseDirectory, File outputDirectory, DocumentModel documentModel, DocumentRendererContext context ) throws DocumentRendererException, IOException { render( getFilesToProcess( baseDirectory ), outputDirectory, documentModel, context ); } /** * Render a document from the files found in baseDirectory. This just forwards to * {@link #render(File,File,DocumentModel)} with a new DocumentModel. * * @param baseDirectory the directory containing the source files. * This should follow the standard Maven convention, ie containing all the site modules. * @param outputDirectory the output directory where the document should be generated. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any * @see #render(File, File, DocumentModel) */ public void render( File baseDirectory, File outputDirectory ) throws DocumentRendererException, IOException { render( baseDirectory, outputDirectory, (DocumentModel) null ); } /** * Render a document from the files found in baseDirectory. * * @param baseDirectory the directory containing the source files. * This should follow the standard Maven convention, ie containing all the site modules. * @param outputDirectory the output directory where the document should be generated. * @param documentDescriptor a file containing the document model. * If this file does not exist or is null, some default settings will be used. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any * @see #render(File, File) if documentDescriptor does not exist or is null * @see #render(Map, File, DocumentModel) otherwise */ public void render( File baseDirectory, File outputDirectory, File documentDescriptor ) throws DocumentRendererException, IOException { if ( ( documentDescriptor == null ) || ( !documentDescriptor.exists() ) ) { getLogger().warn( "No documentDescriptor found: using default settings!" ); render( baseDirectory, outputDirectory ); } else { render( getFilesToProcess( baseDirectory ), outputDirectory, readDocumentModel( documentDescriptor ), null ); } } /** * Render documents separately for each file found in a Map. * * @param filesToProcess the Map of Files to process. The Map should contain as keys the paths of the * source files (relative to {@link #getBaseDir() baseDir}), and the corresponding SiteModule as values. * @param outputDirectory the output directory where the documents should be generated. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any * @since 1.1.1 * @deprecated since 1.1.2, use {@link #renderIndividual(Map, File, DocumentRendererContext)} */ public void renderIndividual( Map filesToProcess, File outputDirectory ) throws DocumentRendererException, IOException { // nop } /** * Render documents separately for each file found in a Map. * * @param filesToProcess the Map of Files to process. The Map should contain as keys the paths of the * source files (relative to {@link #getBaseDir() baseDir}), and the corresponding SiteModule as values. * @param outputDirectory the output directory where the documents should be generated. * @param context the rendering context. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any * @since 1.1.2 */ public void renderIndividual( Map filesToProcess, File outputDirectory, DocumentRendererContext context ) throws DocumentRendererException, IOException { // nop } /** * Returns a Map of files to process. The Map contains as keys the paths of the source files * (relative to {@link #getBaseDir() baseDir}), and the corresponding SiteModule as values. * * @param baseDirectory the directory containing the source files. * This should follow the standard Maven convention, ie containing all the site modules. * @return a Map of files to process. * @throws java.io.IOException in case of a problem reading the files under baseDirectory. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any */ public Map getFilesToProcess( File baseDirectory ) throws IOException, DocumentRendererException { if ( !baseDirectory.isDirectory() ) { getLogger().warn( "No files found to process!" ); return new HashMap(); } setBaseDir( baseDirectory.getAbsolutePath() ); Map filesToProcess = new LinkedHashMap(); Map duplicatesFiles = new LinkedHashMap(); for ( Iterator i = siteModuleManager.getSiteModules().iterator(); i.hasNext(); ) { SiteModule module = (SiteModule) i.next(); File moduleBasedir = new File( baseDirectory, module.getSourceDirectory() ); if ( moduleBasedir.exists() ) { // TODO: handle in/excludes List allFiles = FileUtils.getFileNames( moduleBasedir, "**/*.*", null, false ); String lowerCaseExtension = module.getExtension().toLowerCase( Locale.ENGLISH ); List docs = new LinkedList( allFiles ); // Take care of extension case for ( Iterator it = docs.iterator(); it.hasNext(); ) { String name = it.next().toString().trim(); if ( !name.toLowerCase( Locale.ENGLISH ).endsWith( "." + lowerCaseExtension ) ) { it.remove(); } } List velocityFiles = new LinkedList( allFiles ); // *.xml.vm for ( Iterator it = velocityFiles.iterator(); it.hasNext(); ) { String name = it.next().toString().trim(); if ( !name.toLowerCase( Locale.ENGLISH ).endsWith( lowerCaseExtension + ".vm" ) ) { it.remove(); } } docs.addAll( velocityFiles ); for ( Iterator j = docs.iterator(); j.hasNext(); ) { String filePath = j.next().toString().trim(); if ( filePath.lastIndexOf( "." ) > 0 ) { String key = filePath.substring( 0, filePath.lastIndexOf( "." ) ); if ( duplicatesFiles.containsKey( key ) ) { throw new DocumentRendererException( "Files '" + module.getSourceDirectory() + File.separator + filePath + "' clashes with existing '" + duplicatesFiles.get( key ) + "'." ); } duplicatesFiles.put( key, module.getSourceDirectory() + File.separator + filePath ); } filesToProcess.put( filePath, module ); } } } return filesToProcess; } /** * Returns a Map of files to process. The Map contains as keys the paths of the source files * (relative to {@link #getBaseDir() baseDir}), and the corresponding SiteModule as values. * * @param files The Collection of source files. * @return a Map of files to process. */ public Map getFilesToProcess( Collection files ) { // ---------------------------------------------------------------------- // Map all the file names to parser ids // ---------------------------------------------------------------------- Map filesToProcess = new HashMap(); for ( Iterator it = siteModuleManager.getSiteModules().iterator(); it.hasNext(); ) { SiteModule siteModule = (SiteModule) it.next(); String extension = "." + siteModule.getExtension(); String sourceDirectory = File.separator + siteModule.getSourceDirectory() + File.separator; for ( Iterator j = files.iterator(); j.hasNext(); ) { String file = (String) j.next(); // first check if the file path contains one of the recognized source dir identifiers // (there's trouble if a pathname contains 2 identifiers), then match file extensions (not unique). if ( file.indexOf( sourceDirectory ) != -1 ) { filesToProcess.put( file, siteModule ); } else if ( file.toLowerCase( Locale.ENGLISH ).endsWith( extension ) ) { // don't overwrite if it's there already if ( !filesToProcess.containsKey( file ) ) { filesToProcess.put( file, siteModule ); } } } } return filesToProcess; } /** {@inheritDoc} */ public DocumentModel readDocumentModel( File documentDescriptor ) throws DocumentRendererException, IOException { DocumentModel documentModel; Reader reader = null; try { reader = ReaderFactory.newXmlReader( documentDescriptor ); documentModel = new DocumentXpp3Reader().read( reader ); } catch ( XmlPullParserException e ) { throw new DocumentRendererException( "Error parsing document descriptor", e ); } finally { IOUtil.close( reader ); } return documentModel; } /** * Sets the current base directory. * * @param newDir the absolute path to the base directory to set. */ public void setBaseDir( String newDir ) { this.baseDir = newDir; } /** * Return the current base directory. * * @return the current base directory. */ public String getBaseDir() { return this.baseDir; } //-------------------------------------------- // //-------------------------------------------- /** * Parse a source document into a sink. * * @param fullDocPath absolute path to the source document. * @param parserId determines the parser to use. * @param sink the sink to receive the events. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException in case of a parsing error. * @throws java.io.IOException if the source document cannot be opened. * @deprecated since 1.1.2, use {@link #parse(String, String, Sink, DocumentRendererContext)} */ protected void parse( String fullDocPath, String parserId, Sink sink ) throws DocumentRendererException, IOException { parse( fullDocPath, parserId, sink, null ); } /** * Parse a source document into a sink. * * @param fullDocPath absolute path to the source document. * @param parserId determines the parser to use. * @param sink the sink to receive the events. * @param context the rendering context. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException in case of a parsing error. * @throws java.io.IOException if the source document cannot be opened. */ protected void parse( String fullDocPath, String parserId, Sink sink, DocumentRendererContext context ) throws DocumentRendererException, IOException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Parsing file " + fullDocPath ); } Reader reader = null; try { File f = new File( fullDocPath ); Parser parser = doxia.getParser( parserId ); switch ( parser.getType() ) { case Parser.XML_TYPE: reader = ReaderFactory.newXmlReader( f ); if ( isVelocityFile( f ) ) { reader = getVelocityReader( f, ( (XmlStreamReader) reader ).getEncoding(), context ); } if ( context != null && Boolean.TRUE.equals( (Boolean) context.get( "validate" ) ) ) { reader = validate( reader, fullDocPath ); } break; case Parser.TXT_TYPE: case Parser.UNKNOWN_TYPE: default: if ( isVelocityFile( f ) ) { reader = getVelocityReader( f, ( context == null ? ReaderFactory.FILE_ENCODING : context.getInputEncoding() ), context ); } else { if ( context == null ) { reader = ReaderFactory.newPlatformReader( f ); } else { reader = ReaderFactory.newReader( f, context.getInputEncoding() ); } } } sink.enableLogging( new PlexusLoggerWrapper( getLogger() ) ); doxia.parse( reader, parserId, sink ); } catch ( ParserNotFoundException e ) { throw new DocumentRendererException( "No parser '" + parserId + "' found for " + fullDocPath + ": " + e.getMessage(), e ); } catch ( ParseException e ) { throw new DocumentRendererException( "Error parsing " + fullDocPath + ": " + e.getMessage(), e ); } finally { IOUtil.close( reader ); sink.flush(); } } /** * Copies the contents of the resource directory to an output folder. * * @param outputDirectory the destination folder. * @throws java.io.IOException if any. */ protected void copyResources( File outputDirectory ) throws IOException { File resourcesDirectory = new File( getBaseDir(), "resources" ); if ( !resourcesDirectory.isDirectory() ) { return; } if ( !outputDirectory.exists() ) { outputDirectory.mkdirs(); } copyDirectory( resourcesDirectory, outputDirectory ); } /** * Copy content of a directory, excluding scm-specific files. * * @param source directory that contains the files and sub-directories to be copied. * @param destination destination folder. * @throws java.io.IOException if any. */ protected void copyDirectory( File source, File destination ) throws IOException { if ( source.isDirectory() && destination.isDirectory() ) { DirectoryScanner scanner = new DirectoryScanner(); String[] includedResources = {"**/**"}; scanner.setIncludes( includedResources ); scanner.addDefaultExcludes(); scanner.setBasedir( source ); scanner.scan(); List includedFiles = Arrays.asList( scanner.getIncludedFiles() ); for ( Iterator j = includedFiles.iterator(); j.hasNext(); ) { String name = (String) j.next(); File sourceFile = new File( source, name ); File destinationFile = new File( destination, name ); FileUtils.copyFile( sourceFile, destinationFile ); } } } /** * @param documentModel not null * @return the output name defined in the documentModel without the output extension. If the output name is not * defined, return target by default. * @since 1.1.1 * @see org.apache.maven.doxia.document.DocumentModel#getOutputName() * @see #getOutputExtension() */ protected String getOutputName( DocumentModel documentModel ) { String outputName = documentModel.getOutputName(); if ( outputName == null ) { getLogger().info( "No outputName is defined in the document descriptor. Using 'target'" ); documentModel.setOutputName( "target" ); } outputName = outputName.trim(); if ( outputName.toLowerCase( Locale.ENGLISH ).endsWith( "." + getOutputExtension() ) ) { outputName = outputName.substring( 0, outputName.toLowerCase( Locale.ENGLISH ) .lastIndexOf( "." + getOutputExtension() ) ); } documentModel.setOutputName( outputName ); return documentModel.getOutputName(); } /** * TODO: DOXIA-111: we need a general filter here that knows how to alter the context * * @param f the file to process, not null * @param encoding the wanted encoding, not null * @param context the current render document context not null * @return a reader with * @throws DocumentRendererException */ private Reader getVelocityReader( File f, String encoding, DocumentRendererContext context ) throws DocumentRendererException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Velocity render for " + f.getAbsolutePath() ); } SiteResourceLoader.setResource( f.getAbsolutePath() ); Context velocityContext = new VelocityContext(); if ( context.getKeys() != null ) { for ( int i = 0; i < context.getKeys().length; i++ ) { String key = (String) context.getKeys()[i]; velocityContext.put( key, context.get( key ) ); } } StringWriter sw = new StringWriter(); try { velocity.getEngine().mergeTemplate( f.getAbsolutePath(), encoding, velocityContext, sw ); } catch ( Exception e ) { throw new DocumentRendererException( "Error whenn parsing Velocity file " + f.getAbsolutePath() + ": " + e.getMessage(), e ); } return new StringReader( sw.toString() ); } /** * @param f not null * @return true if file has a vm extension, false otherwise. */ private static boolean isVelocityFile( File f ) { return FileUtils.getExtension( f.getAbsolutePath() ).toLowerCase( Locale.ENGLISH ).endsWith( "vm" ); } private Reader validate( Reader source, String resource ) throws ParseException, IOException { getLogger().debug( "Validating: " + resource ); try { String content = IOUtil.toString( new BufferedReader( source ) ); new XmlValidator( new PlexusLoggerWrapper( getLogger() ) ).validate( content ); return new StringReader( content ); } finally { IOUtil.close( source ); } } } doxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/0000755000175000017500000000000011633153574032574 5ustar twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/RtfRenderer.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/RtfR0000644000175000017500000000251111212710420033351 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer.itext; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.doxia.docrenderer.DocRenderer; /** * RTF renderer interface for the iText framework * * @author Vincent Siveton * @version $Id: RtfRenderer.java 782357 2009-06-07 10:06:08Z vsiveton $ * @deprecated since 1.1, use an implementation of {@link org.apache.maven.doxia.docrenderer.DocumentRenderer}. */ public interface RtfRenderer extends DocRenderer { String ROLE = RtfRenderer.class.getName(); } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/AbstractITextRender.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/Abst0000644000175000017500000004543311212746552033416 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer.itext; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.io.Reader; import java.io.Writer; import java.net.URL; import java.net.URLClassLoader; import java.util.Date; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; import org.apache.maven.doxia.Doxia; import org.apache.maven.doxia.docrenderer.DocRenderer; import org.apache.maven.doxia.docrenderer.DocumentRendererException; import org.apache.maven.doxia.document.DocumentModel; import org.apache.maven.doxia.document.DocumentTOCItem; import org.apache.maven.doxia.document.io.xpp3.DocumentXpp3Reader; import org.apache.maven.doxia.module.itext.ITextSink; import org.apache.maven.doxia.module.itext.ITextSinkFactory; import org.apache.maven.doxia.module.itext.ITextUtil; import org.apache.maven.doxia.module.site.SiteModule; import org.apache.maven.doxia.module.site.manager.SiteModuleManager; import org.apache.maven.doxia.parser.ParseException; import org.apache.maven.doxia.parser.manager.ParserNotFoundException; import org.apache.xml.utils.DefaultErrorHandler; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.WriterFactory; import org.codehaus.plexus.util.xml.XmlUtil; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.xml.sax.SAXException; import com.lowagie.text.ElementTags; /** * Abstract document render with the iText framework * * @author Vincent Siveton * @version $Id: AbstractITextRender.java 782393 2009-06-07 14:23:38Z vsiveton $ * @deprecated since 1.1, use an implementation of {@link org.apache.maven.doxia.docrenderer.DocumentRenderer}. */ public abstract class AbstractITextRender extends AbstractLogEnabled implements DocRenderer { private static final String XSLT_RESOURCE = "org/apache/maven/doxia/docrenderer/pdf/itext/TOC.xslt"; private static final TransformerFactory TRANSFORMER_FACTORY = TransformerFactory.newInstance(); private static final DocumentBuilderFactory DOCUMENT_BUILDER_FACTORY = DocumentBuilderFactory.newInstance(); /** * @plexus.requirement */ protected SiteModuleManager siteModuleManager; /** * @plexus.requirement */ protected Doxia doxia; static { TRANSFORMER_FACTORY.setErrorListener( new DefaultErrorHandler() ); } /** {@inheritDoc} */ public void render( File siteDirectory, File outputDirectory ) throws DocumentRendererException, IOException { for ( Iterator i = siteModuleManager.getSiteModules().iterator(); i.hasNext(); ) { SiteModule module = (SiteModule) i.next(); File moduleBasedir = new File( siteDirectory, module.getSourceDirectory() ); if ( moduleBasedir.exists() ) { List docs = FileUtils.getFileNames( moduleBasedir, "**/*." + module.getExtension(), null, false ); for ( Iterator j = docs.iterator(); j.hasNext(); ) { String doc = (String) j.next(); String fullPathDoc = new File( moduleBasedir, doc ).getPath(); String outputITextName = doc.substring( 0, doc.indexOf( "." ) + 1 ) + "xml"; File outputITextFile = new File( outputDirectory, outputITextName ); if ( !outputITextFile.getParentFile().exists() ) { outputITextFile.getParentFile().mkdirs(); } String iTextOutputName = doc.substring( 0, doc.indexOf( "." ) + 1 ) + getOutputExtension(); File iTextOutputFile = new File( outputDirectory, iTextOutputName ); if ( !iTextOutputFile.getParentFile().exists() ) { iTextOutputFile.getParentFile().mkdirs(); } parse( fullPathDoc, module, outputITextFile ); generateOutput( outputITextFile, iTextOutputFile ); } } } } /** {@inheritDoc} */ public void render( File siteDirectory, File outputDirectory, File documentDescriptor ) throws DocumentRendererException, IOException { if ( ( documentDescriptor == null ) || ( !documentDescriptor.exists() ) ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "No documentDescriptor is found. Generate all documents." ); } render( siteDirectory, outputDirectory ); return; } DocumentModel documentModel; Reader reader = null; try { reader = ReaderFactory.newXmlReader( documentDescriptor ); documentModel = new DocumentXpp3Reader().read( reader ); } catch ( XmlPullParserException e ) { throw new DocumentRendererException( "Error parsing document descriptor", e ); } catch ( IOException e ) { throw new DocumentRendererException( "Error reading document descriptor", e ); } finally { IOUtil.close( reader ); } if ( documentModel.getOutputName() == null ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "No outputName is defined in the document descriptor. Using 'generated_itext'" ); } documentModel.setOutputName( "generated_itext" ); } if ( ( documentModel.getToc() == null ) || ( documentModel.getToc().getItems() == null ) ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "No TOC is defined in the document descriptor. Merging all documents." ); } } List iTextFiles = new LinkedList(); for ( Iterator i = siteModuleManager.getSiteModules().iterator(); i.hasNext(); ) { SiteModule module = (SiteModule) i.next(); File moduleBasedir = new File( siteDirectory, module.getSourceDirectory() ); if ( moduleBasedir.exists() ) { List docs = FileUtils.getFileNames( moduleBasedir, "**/*." + module.getExtension(), null, false ); for ( Iterator j = docs.iterator(); j.hasNext(); ) { String doc = (String) j.next(); String fullPathDoc = new File( moduleBasedir, doc ).getPath(); String outputITextName = doc.substring( 0, doc.lastIndexOf( "." ) + 1 ) + "xml"; File outputITextFile = new File( outputDirectory, outputITextName ); if ( ( documentModel.getToc() == null ) || ( documentModel.getToc().getItems() == null ) ) { iTextFiles.add( outputITextFile ); if ( !outputITextFile.getParentFile().exists() ) { outputITextFile.getParentFile().mkdirs(); } parse( fullPathDoc, module, outputITextFile ); } else { for ( Iterator k = documentModel.getToc().getItems().iterator(); k.hasNext(); ) { DocumentTOCItem tocItem = (DocumentTOCItem) k.next(); if ( tocItem.getRef() == null ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "No ref defined for an tocItem in the document descriptor." ); } continue; } String outTmp = StringUtils.replace( outputITextFile.getAbsolutePath(), "\\", "/" ); outTmp = outTmp.substring( 0, outTmp.lastIndexOf( "." ) ); String outRef = StringUtils.replace( tocItem.getRef(), "\\", "/" ); if ( outRef.lastIndexOf( "." ) != -1 ) { outRef = outRef.substring( 0, outRef.lastIndexOf( "." ) ); } else { outRef = outRef.substring( 0, outRef.length() ); } if ( outTmp.indexOf( outRef ) != -1 ) { iTextFiles.add( outputITextFile ); if ( !outputITextFile.getParentFile().exists() ) { outputITextFile.getParentFile().mkdirs(); } parse( fullPathDoc, module, outputITextFile ); } } } } } } File iTextFile = new File( outputDirectory, documentModel.getOutputName() + ".xml" ); File iTextOutput = new File( outputDirectory, documentModel.getOutputName() + "." + getOutputExtension() ); Document document = generateDocument( iTextFiles ); transform( documentModel, document, iTextFile ); generateOutput( iTextFile, iTextOutput ); } /** * Generate an ouput file with the iText framework * * @param iTextFile * @param iTextOutput * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any */ public abstract void generateOutput( File iTextFile, File iTextOutput ) throws DocumentRendererException, IOException; /** * Parse a sink * * @param fullPathDoc * @param module * @param outputITextFile * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException * @throws java.io.IOException */ private void parse( String fullPathDoc, SiteModule module, File outputITextFile ) throws DocumentRendererException, IOException { Writer writer = WriterFactory.newXmlWriter( outputITextFile ); ITextSink sink = (ITextSink) new ITextSinkFactory().createSink( writer ); sink.setClassLoader( new URLClassLoader( new URL[] { outputITextFile.getParentFile().toURI().toURL() } ) ); Reader reader = null; try { File f = new File( fullPathDoc ); if ( XmlUtil.isXml( f ) ) { reader = ReaderFactory.newXmlReader( f ); } else { // TODO Platform dependent? reader = ReaderFactory.newPlatformReader( f ); } System.setProperty( "itext.basedir", outputITextFile.getParentFile().getAbsolutePath() ); doxia.parse( reader, module.getParserId(), sink ); } catch ( ParserNotFoundException e ) { throw new DocumentRendererException( "Error getting a parser for '" + fullPathDoc + "': " + e.getMessage() ); } catch ( ParseException e ) { throw new DocumentRendererException( "Error parsing '" + fullPathDoc + "': line [" + e.getLineNumber() + "] " + e.getMessage(), e ); } finally { IOUtil.close( reader ); sink.flush(); sink.close(); IOUtil.close( writer ); System.getProperties().remove( "itext.basedir" ); } } /** * Merge all iTextFiles to a single one * * @param iTextFiles * @return a document * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any */ private Document generateDocument( List iTextFiles ) throws DocumentRendererException, IOException { Document document; try { document = DOCUMENT_BUILDER_FACTORY.newDocumentBuilder().newDocument(); } catch ( ParserConfigurationException e ) { throw new DocumentRendererException( "Error building document :" + e.getMessage() ); } document.appendChild( document.createElement( ElementTags.ITEXT ) ); // Used only to set a root for ( int i = 0; i < iTextFiles.size(); i++ ) { File iTextFile = (File) iTextFiles.get( i ); Document iTextDocument; try { iTextDocument = DOCUMENT_BUILDER_FACTORY.newDocumentBuilder().parse( iTextFile ); } catch ( SAXException e ) { throw new DocumentRendererException( "SAX Error : " + e.getMessage() ); } catch ( ParserConfigurationException e ) { throw new DocumentRendererException( "Error parsing configuration : " + e.getMessage() ); } // Only one chapter per doc Node chapter = iTextDocument.getElementsByTagName( ElementTags.CHAPTER ).item( 0 ); try { document.getDocumentElement().appendChild( document.importNode( chapter, true ) ); } catch ( DOMException e ) { throw new DocumentRendererException( "Error appending chapter for " + iTextFile + " : " + e.getMessage() ); } } return document; } /** * Init the transformer object * * @return an instanced transformer object * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any */ private Transformer initTransformer() throws DocumentRendererException { try { Transformer transformer = TRANSFORMER_FACTORY.newTransformer( new StreamSource( DefaultPdfRenderer.class .getResourceAsStream( "/" + XSLT_RESOURCE ) ) ); transformer.setErrorListener( TRANSFORMER_FACTORY.getErrorListener() ); transformer.setOutputProperty( OutputKeys.OMIT_XML_DECLARATION, "false" ); transformer.setOutputProperty( OutputKeys.INDENT, "yes" ); transformer.setOutputProperty( OutputKeys.METHOD, "xml" ); transformer.setOutputProperty( OutputKeys.ENCODING, "UTF-8" ); return transformer; } catch ( TransformerConfigurationException e ) { throw new DocumentRendererException( "Error configuring Transformer for " + XSLT_RESOURCE + ": " + e.getMessage() ); } catch ( IllegalArgumentException e ) { throw new DocumentRendererException( "Error configuring Transformer for " + XSLT_RESOURCE + ": " + e.getMessage() ); } } /** * Add transformer parameters * * @param transformer * @param documentModel */ private void addTransformerParameters( Transformer transformer, DocumentModel documentModel ) { if ( documentModel.getMeta().getTitle() != null ) { transformer.setParameter( "title", documentModel.getMeta().getTitle() ); } if ( documentModel.getMeta().getAuthor() != null ) { transformer.setParameter( "author", documentModel.getMeta().getAuthor() ); } transformer.setParameter( "creationdate", new Date().toString() ); if ( documentModel.getMeta().getSubject() != null ) { transformer.setParameter( "subject", documentModel.getMeta().getSubject() ); } if ( documentModel.getMeta().getKeywords() != null ) { transformer.setParameter( "keywords", documentModel.getMeta().getKeywords() ); } transformer.setParameter( "producer", "Generated with Doxia by " + System.getProperty( "user.name" ) ); if ( ITextUtil.isPageSizeSupported( documentModel.getMeta().getTitle() ) ) { transformer.setParameter( "pagesize", documentModel.getMeta().getPageSize() ); } else { transformer.setParameter( "pagesize", "A4" ); } transformer.setParameter( "frontPageHeader", "" ); if ( documentModel.getMeta().getTitle() != null ) { transformer.setParameter( "frontPageTitle", documentModel.getMeta().getTitle() ); } transformer.setParameter( "frontPageFooter", "Generated date " + new Date().toString() ); } /** * Transform a document to an iTextFile * * @param documentModel * @param document * @param iTextFile * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any. */ private void transform( DocumentModel documentModel, Document document, File iTextFile ) throws DocumentRendererException { Transformer transformer = initTransformer(); addTransformerParameters( transformer, documentModel ); try { transformer.transform( new DOMSource( document ), new StreamResult( iTextFile ) ); } catch ( TransformerException e ) { throw new DocumentRendererException( "Error transformer Document from " + document + ": " + e.getMessage() ); } } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/DefaultPdfRenderer.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/Defa0000644000175000017500000000440311212710420033335 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer.itext; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import org.apache.maven.doxia.docrenderer.DocumentRendererException; import org.apache.maven.doxia.module.itext.ITextUtil; /** * PDF render with the iText framework * * @author Vincent Siveton * @version $Id: DefaultPdfRenderer.java 782357 2009-06-07 10:06:08Z vsiveton $ * @plexus.component role="org.apache.maven.doxia.docrenderer.itext.PdfRenderer" role-hint="itext.pdf" * @deprecated since 1.1, use {@link org.apache.maven.doxia.docrenderer.pdf.itext.ITextPdfRenderer}. */ public class DefaultPdfRenderer extends AbstractITextRender implements PdfRenderer { /** {@inheritDoc} */ public String getOutputExtension() { return "pdf"; } /** {@inheritDoc} */ public void generateOutput( File iTextFile, File iTextOutput ) throws DocumentRendererException, IOException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Writing : " + iTextOutput ); } try { ITextUtil.writePdf( new FileInputStream( iTextFile ), new FileOutputStream( iTextOutput ) ); } catch ( RuntimeException e ) { throw new DocumentRendererException( "Error writing PDF from " + iTextOutput + ": " + e.getMessage() ); } } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/PdfRenderer.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/PdfR0000644000175000017500000000251111212710420033327 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer.itext; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.doxia.docrenderer.DocRenderer; /** * PDF renderer interface for the iText framework * * @author Vincent Siveton * @version $Id: PdfRenderer.java 782357 2009-06-07 10:06:08Z vsiveton $ * @deprecated since 1.1, use an implementation of {@link org.apache.maven.doxia.docrenderer.DocumentRenderer}. */ public interface PdfRenderer extends DocRenderer { String ROLE = PdfRenderer.class.getName(); } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/DefaultRtfRenderer.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/Defa0000644000175000017500000000440311212710420033335 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer.itext; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import org.apache.maven.doxia.docrenderer.DocumentRendererException; import org.apache.maven.doxia.module.itext.ITextUtil; /** * RTF render with the iText framework * * @author Vincent Siveton * @version $Id: DefaultRtfRenderer.java 782357 2009-06-07 10:06:08Z vsiveton $ * @plexus.component role="org.apache.maven.doxia.docrenderer.itext.RtfRenderer" role-hint="itext.rtf" * @deprecated since 1.1, use {@link org.apache.maven.doxia.docrenderer.pdf.itext.ITextPdfRenderer}. */ public class DefaultRtfRenderer extends AbstractITextRender implements RtfRenderer { /** {@inheritDoc} */ public String getOutputExtension() { return "rtf"; } /** {@inheritDoc} */ public void generateOutput( File iTextFile, File iTextOutput ) throws DocumentRendererException, IOException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Writing : " + iTextOutput ); } try { ITextUtil.writeRtf( new FileInputStream( iTextFile ), new FileOutputStream( iTextOutput ) ); } catch ( RuntimeException e ) { throw new DocumentRendererException( "Error writing RTF from " + iTextOutput + ": " + e.getMessage() ); } } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRendererException.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRe0000644000175000017500000000316411150516002033412 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * A document renderer exception * * @author Vincent Siveton * @version $Id: DocumentRendererException.java 746998 2009-02-23 12:52:18Z vsiveton $ * @since 1.1 */ public class DocumentRendererException extends Exception { /** serialVersionUID */ static final long serialVersionUID = 295967936746221567L; /** * Default constructor. * * @param message An error message. */ public DocumentRendererException( String message ) { super( message ); } /** * Other constructor. * * @param message An error message. * @param t The cause. */ public DocumentRendererException( String message, Throwable t ) { super( message, t ); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRendererContext.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRe0000644000175000017500000000720511236037607033430 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.HashMap; import java.util.Map; import org.codehaus.plexus.util.ReaderFactory; /** * Context when processing Velocity files using a {@link java.util.HashMap} for data storage. * * @author Vincent Siveton * @version $Id: DocumentRendererContext.java 800802 2009-08-04 14:02:47Z vsiveton $ * @since 1.1.2 */ public class DocumentRendererContext { private String inputEncoding = ReaderFactory.UTF_8; /** * Storage for key/value pairs. */ private final Map context; /** * Default constructor. */ public DocumentRendererContext() { context = new HashMap(); } /** * @return The input encoding when processing files. */ public String getInputEncoding() { return inputEncoding; } /** * @param inputEncoding new input encoding value when processing files. */ public void setInputEncoding( String inputEncoding ) { this.inputEncoding = inputEncoding; } /** * Adds a name/value pair to the context. * * @param key The name to key the provided value with. * @param value The corresponding value. * @return Object that was replaced in the the Context if applicable or null if not. */ public Object put( String key, Object value ) { if ( key == null ) { return null; } return context.put( key, value ); } /** * Gets the value corresponding to the provided key from the context. * * @param key The name of the desired value. * @return The value corresponding to the provided key or null if the key param is null. */ public Object get( String key ) { if ( key == null ) { return null; } return context.get( key ); } /** * Indicates whether the specified key is in the context. * * @param key The key to look for. * @return true if the key is in the context, false if not. */ public boolean containsKey( Object key ) { if ( key == null ) { return false; } return context.containsKey( key ); } /** * Get all the keys for the values in the context * * @return Object[] of keys in the Context. */ public Object[] getKeys() { return context.keySet().toArray(); } /** * Removes the value associated with the specified key from the context. * * @param key The name of the value to remove. * @return The value that the key was mapped to, or null if unmapped. */ public Object remove( Object key ) { if ( key == null ) { return null; } return context.remove( key ); } } doxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/0000755000175000017500000000000011633153574032210 5ustar twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/itext/doxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/itext/0000755000175000017500000000000011633153574033345 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/itext/ITextPdfRenderer.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/itext/0000644000175000017500000006235511250471607033355 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer.pdf.itext; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; import org.apache.maven.doxia.docrenderer.DocumentRendererContext; import org.apache.maven.doxia.docrenderer.DocumentRendererException; import org.apache.maven.doxia.docrenderer.pdf.AbstractPdfRenderer; import org.apache.maven.doxia.document.DocumentCover; import org.apache.maven.doxia.document.DocumentMeta; import org.apache.maven.doxia.document.DocumentModel; import org.apache.maven.doxia.document.DocumentTOCItem; import org.apache.maven.doxia.module.itext.ITextSink; import org.apache.maven.doxia.module.itext.ITextSinkFactory; import org.apache.maven.doxia.module.itext.ITextUtil; import org.apache.maven.doxia.module.site.SiteModule; import org.apache.xml.utils.DefaultErrorHandler; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.WriterFactory; import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.xml.sax.SAXException; import com.lowagie.text.ElementTags; /** * Abstract document render with the iText framework * * @author Vincent Siveton * @author ltheussl * @version $Id: ITextPdfRenderer.java 811653 2009-09-05 14:19:51Z vsiveton $ * @since 1.1 * @plexus.component role="org.apache.maven.doxia.docrenderer.pdf.PdfRenderer" role-hint="itext" */ public class ITextPdfRenderer extends AbstractPdfRenderer { /** The xslt style sheet used to transform a Document to an iText file. */ private static final String XSLT_RESOURCE = "TOC.xslt"; /** The TransformerFactory. */ private static final TransformerFactory TRANSFORMER_FACTORY = TransformerFactory.newInstance(); /** The DocumentBuilderFactory. */ private static final DocumentBuilderFactory DOCUMENT_BUILDER_FACTORY = DocumentBuilderFactory.newInstance(); /** The DocumentBuilder. */ private static final DocumentBuilder DOCUMENT_BUILDER; static { TRANSFORMER_FACTORY.setErrorListener( new DefaultErrorHandler() ); try { DOCUMENT_BUILDER = DOCUMENT_BUILDER_FACTORY.newDocumentBuilder(); } catch ( ParserConfigurationException e ) { throw new RuntimeException( "Error building document :" + e.getMessage() ); } } /** {@inheritDoc} */ public void generatePdf( File inputFile, File pdfFile ) throws DocumentRendererException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Generating : " + pdfFile ); } try { ITextUtil.writePdf( new FileInputStream( inputFile ), new FileOutputStream( pdfFile ) ); } catch ( IOException e ) { throw new DocumentRendererException( "Cannot create PDF from " + inputFile + ": " + e.getMessage(), e ); } catch ( RuntimeException e ) { throw new DocumentRendererException( "Error creating PDF from " + inputFile + ": " + e.getMessage(), e ); } } /** {@inheritDoc} */ public void render( Map filesToProcess, File outputDirectory, DocumentModel documentModel ) throws DocumentRendererException, IOException { render( filesToProcess, outputDirectory, documentModel, null ); } /** {@inheritDoc} */ public void render( Map filesToProcess, File outputDirectory, DocumentModel documentModel, DocumentRendererContext context ) throws DocumentRendererException, IOException { // copy resources, images, etc. copyResources( outputDirectory ); if ( documentModel == null ) { getLogger().debug( "No document model, generating all documents individually." ); renderIndividual( filesToProcess, outputDirectory, context ); return; } String outputName = getOutputName( documentModel ); File outputITextFile = new File( outputDirectory, outputName + ".xml" ); if ( !outputITextFile.getParentFile().exists() ) { outputITextFile.getParentFile().mkdirs(); } File pdfOutputFile = new File( outputDirectory, outputName + ".pdf" ); if ( !pdfOutputFile.getParentFile().exists() ) { pdfOutputFile.getParentFile().mkdirs(); } List iTextFiles; if ( ( documentModel.getToc() == null ) || ( documentModel.getToc().getItems() == null ) ) { getLogger().info( "No TOC is defined in the document descriptor. Merging all documents." ); iTextFiles = parseAllFiles( filesToProcess, outputDirectory, context ); } else { getLogger().debug( "Using TOC defined in the document descriptor." ); iTextFiles = parseTOCFiles( outputDirectory, documentModel, context ); } String generateTOC = ( context != null && context.get( "generateTOC" ) != null ? context.get( "generateTOC" ).toString() : "start" ); File iTextFile = new File( outputDirectory, outputName + ".xml" ); File iTextOutput = new File( outputDirectory, outputName + "." + getOutputExtension() ); Document document = generateDocument( iTextFiles ); transform( documentModel, document, iTextFile, generateTOC ); generatePdf( iTextFile, iTextOutput ); } /** {@inheritDoc} */ public void renderIndividual( Map filesToProcess, File outputDirectory ) throws DocumentRendererException, IOException { renderIndividual( filesToProcess, outputDirectory, null ); } /** {@inheritDoc} */ public void renderIndividual( Map filesToProcess, File outputDirectory, DocumentRendererContext context ) throws DocumentRendererException, IOException { for ( Iterator it = filesToProcess.keySet().iterator(); it.hasNext(); ) { String key = (String) it.next(); SiteModule module = (SiteModule) filesToProcess.get( key ); File fullDoc = new File( getBaseDir(), module.getSourceDirectory() + File.separator + key ); String output = key; String lowerCaseExtension = module.getExtension().toLowerCase( Locale.ENGLISH ); if ( output.toLowerCase( Locale.ENGLISH ).indexOf( "." + lowerCaseExtension ) != -1 ) { output = output.substring( 0, output.toLowerCase( Locale.ENGLISH ).indexOf( "." + lowerCaseExtension ) ); } File outputITextFile = new File( outputDirectory, output + ".xml" ); if ( !outputITextFile.getParentFile().exists() ) { outputITextFile.getParentFile().mkdirs(); } File pdfOutputFile = new File( outputDirectory, output + ".pdf" ); if ( !pdfOutputFile.getParentFile().exists() ) { pdfOutputFile.getParentFile().mkdirs(); } parse( fullDoc, module, outputITextFile, context ); generatePdf( outputITextFile, pdfOutputFile ); } } //-------------------------------------------- // //-------------------------------------------- /** * Parse a source document and emit results into a sink. * * @param fullDocPath file to the source document. * @param module the site module associated with the source document (determines the parser to use). * @param iTextFile the resulting iText xml file. * @throws DocumentRendererException in case of a parsing problem. * @throws IOException if the source and/or target document cannot be opened. */ private void parse( File fullDoc, SiteModule module, File iTextFile, DocumentRendererContext context ) throws DocumentRendererException, IOException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Parsing file " + fullDoc.getAbsolutePath() ); } System.setProperty( "itext.basedir", iTextFile.getParentFile().getAbsolutePath() ); Writer writer = null; ITextSink sink = null; try { writer = WriterFactory.newXmlWriter( iTextFile ); sink = (ITextSink) new ITextSinkFactory().createSink( writer ); sink.setClassLoader( new URLClassLoader( new URL[] { iTextFile.getParentFile().toURI().toURL() } ) ); parse( fullDoc.getAbsolutePath(), module.getParserId(), sink, context ); } finally { if ( sink != null ) { sink.flush(); sink.close(); } IOUtil.close( writer ); System.getProperties().remove( "itext.basedir" ); } } /** * Merge all iTextFiles to a single one. * * @param iTextFiles list of iText xml files. * @return Document. * @throws DocumentRendererException if any. * @throws IOException if any. */ private Document generateDocument( List iTextFiles ) throws DocumentRendererException, IOException { Document document = DOCUMENT_BUILDER.newDocument(); document.appendChild( document.createElement( ElementTags.ITEXT ) ); // Used only to set a root for ( int i = 0; i < iTextFiles.size(); i++ ) { File iTextFile = (File) iTextFiles.get( i ); Document iTextDocument; try { iTextDocument = DOCUMENT_BUILDER.parse( iTextFile ); } catch ( SAXException e ) { throw new DocumentRendererException( "SAX Error : " + e.getMessage() ); } // Only one chapter per doc Node chapter = iTextDocument.getElementsByTagName( ElementTags.CHAPTER ).item( 0 ); try { document.getDocumentElement().appendChild( document.importNode( chapter, true ) ); } catch ( DOMException e ) { throw new DocumentRendererException( "Error appending chapter for " + iTextFile + " : " + e.getMessage() ); } } return document; } /** * Initialize the transformer object. * * @return an instance of a transformer object. * @throws DocumentRendererException if any. */ private Transformer initTransformer() throws DocumentRendererException { try { Transformer transformer = TRANSFORMER_FACTORY.newTransformer( new StreamSource( ITextPdfRenderer.class .getResourceAsStream( XSLT_RESOURCE ) ) ); transformer.setErrorListener( TRANSFORMER_FACTORY.getErrorListener() ); transformer.setOutputProperty( OutputKeys.OMIT_XML_DECLARATION, "false" ); transformer.setOutputProperty( OutputKeys.INDENT, "yes" ); transformer.setOutputProperty( OutputKeys.METHOD, "xml" ); transformer.setOutputProperty( OutputKeys.ENCODING, "UTF-8" ); // No doctype since itext doctype is not up to date! return transformer; } catch ( TransformerConfigurationException e ) { throw new DocumentRendererException( "Error configuring Transformer for " + XSLT_RESOURCE + ": " + e.getMessage() ); } catch ( IllegalArgumentException e ) { throw new DocumentRendererException( "Error configuring Transformer for " + XSLT_RESOURCE + ": " + e.getMessage() ); } } /** * Add transformer parameters from a DocumentModel. * * @param transformer the Transformer to set the parameters. * @param documentModel the DocumentModel to take the parameters from, could be null. * @param iTextFile the iTextFile not null for the relative paths. * @param generateTOC not null, possible values are: 'none', 'start' and 'end'. */ private void addTransformerParameters( Transformer transformer, DocumentModel documentModel, File iTextFile, String generateTOC ) { if ( documentModel == null ) { return; } // TOC addTransformerParameter( transformer, "toc.position", generateTOC ); // Meta parameters boolean hasNullMeta = false; if ( documentModel.getMeta() == null ) { hasNullMeta = true; documentModel.setMeta( new DocumentMeta() ); } addTransformerParameter( transformer, "meta.author", documentModel.getMeta().getAllAuthorNames(), System.getProperty( "user.name", "null" ) ); addTransformerParameter( transformer, "meta.creator", documentModel.getMeta().getCreator(), System.getProperty( "user.name", "null" ) ); // see com.lowagie.text.Document#addCreationDate() SimpleDateFormat sdf = new SimpleDateFormat( "EEE MMM dd HH:mm:ss zzz yyyy" ); addTransformerParameter( transformer, "meta.creationdate", documentModel.getMeta().getCreationdate(), sdf.format( new Date() ) ); addTransformerParameter( transformer, "meta.keywords", documentModel.getMeta().getAllKeyWords() ); addTransformerParameter( transformer, "meta.pagesize", documentModel.getMeta().getPageSize(), ITextUtil.getPageSize( ITextUtil.getDefaultPageSize() ) ); addTransformerParameter( transformer, "meta.producer", documentModel.getMeta().getGenerator(), "Apache Doxia iText" ); addTransformerParameter( transformer, "meta.subject", documentModel.getMeta().getSubject(), ( documentModel.getMeta().getTitle() != null ? documentModel.getMeta().getTitle() : "" ) ); addTransformerParameter( transformer, "meta.title", documentModel.getMeta().getTitle() ); if ( hasNullMeta ) { documentModel.setMeta( null ); } // cover parameter boolean hasNullCover = false; if ( documentModel.getCover() == null ) { hasNullCover = true; documentModel.setCover( new DocumentCover() ); } addTransformerParameter( transformer, "cover.author", documentModel.getCover().getAllAuthorNames(), System.getProperty( "user.name", "null" ) ); String companyLogo = getLogoURL( documentModel.getCover().getCompanyLogo(), iTextFile.getParentFile() ); addTransformerParameter( transformer, "cover.companyLogo", companyLogo ); addTransformerParameter( transformer, "cover.companyName", documentModel.getCover().getCompanyName() ); if ( documentModel.getCover().getCoverdate() == null ) { documentModel.getCover().setCoverDate( new Date() ); addTransformerParameter( transformer, "cover.date", documentModel.getCover().getCoverdate() ); documentModel.getCover().setCoverDate( null ); } else { addTransformerParameter( transformer, "cover.date", documentModel.getCover().getCoverdate() ); } addTransformerParameter( transformer, "cover.subtitle", documentModel.getCover().getCoverSubTitle() ); addTransformerParameter( transformer, "cover.title", documentModel.getCover().getCoverTitle() ); addTransformerParameter( transformer, "cover.type", documentModel.getCover().getCoverType() ); addTransformerParameter( transformer, "cover.version", documentModel.getCover().getCoverVersion() ); String projectLogo = getLogoURL( documentModel.getCover().getProjectLogo(), iTextFile.getParentFile() ); addTransformerParameter( transformer, "cover.projectLogo", projectLogo ); addTransformerParameter( transformer, "cover.projectName", documentModel.getCover().getProjectName() ); if ( hasNullCover ) { documentModel.setCover( null ); } } /** * @param transformer not null * @param name not null * @param value could be empty * @param defaultValue could be empty * @since 1.1.1 */ private void addTransformerParameter( Transformer transformer, String name, String value, String defaultValue ) { if ( StringUtils.isEmpty( value ) ) { addTransformerParameter( transformer, name, defaultValue ); } else { addTransformerParameter( transformer, name, value ); } } /** * @param transformer not null * @param name not null * @param value could be empty * @since 1.1.1 */ private void addTransformerParameter( Transformer transformer, String name, String value ) { if ( StringUtils.isEmpty( value ) ) { return; } transformer.setParameter( name, value ); } /** * Transform a document to an iTextFile. * * @param documentModel the DocumentModel to take the parameters from, could be null. * @param document the Document to transform. * @param iTextFile the resulting iText xml file. * @param generateTOC not null, possible values are: 'none', 'start' and 'end'. * @throws DocumentRendererException in case of a transformation error. */ private void transform( DocumentModel documentModel, Document document, File iTextFile, String generateTOC ) throws DocumentRendererException { Transformer transformer = initTransformer(); addTransformerParameters( transformer, documentModel, iTextFile, generateTOC ); // need a writer for StreamResult to prevent FileNotFoundException when iTextFile contains spaces Writer writer = null; try { writer = WriterFactory.newXmlWriter( iTextFile ); transformer.transform( new DOMSource( document ), new StreamResult( writer ) ); } catch ( TransformerException e ) { throw new DocumentRendererException( "Error transforming Document " + document + ": " + e.getMessage(), e ); } catch ( IOException e ) { throw new DocumentRendererException( "Error transforming Document " + document + ": " + e.getMessage(), e ); } finally { IOUtil.close( writer ); } } /** * @param filesToProcess not null * @param outputDirectory not null * @return a list of all parsed files. * @throws DocumentRendererException if any * @throws IOException if any * @since 1.1.1 */ private List parseAllFiles( Map filesToProcess, File outputDirectory, DocumentRendererContext context ) throws DocumentRendererException, IOException { List iTextFiles = new LinkedList(); for ( Iterator it = filesToProcess.keySet().iterator(); it.hasNext(); ) { String key = (String) it.next(); SiteModule module = (SiteModule) filesToProcess.get( key ); File fullDoc = new File( getBaseDir(), module.getSourceDirectory() + File.separator + key ); String outputITextName = key.substring( 0, key.lastIndexOf( "." ) + 1 ) + "xml"; File outputITextFileTmp = new File( outputDirectory, outputITextName ); outputITextFileTmp.deleteOnExit(); if ( !outputITextFileTmp.getParentFile().exists() ) { outputITextFileTmp.getParentFile().mkdirs(); } iTextFiles.add( outputITextFileTmp ); parse( fullDoc, module, outputITextFileTmp, context ); } return iTextFiles; } /** * @param filesToProcess not null * @param outputDirectory not null * @return a list of all parsed files. * @throws DocumentRendererException if any * @throws IOException if any * @since 1.1.1 */ private List parseTOCFiles( File outputDirectory, DocumentModel documentModel, DocumentRendererContext context ) throws DocumentRendererException, IOException { List iTextFiles = new LinkedList(); for ( Iterator it = documentModel.getToc().getItems().iterator(); it.hasNext(); ) { DocumentTOCItem tocItem = (DocumentTOCItem) it.next(); if ( tocItem.getRef() == null ) { getLogger().debug( "No ref defined for the tocItem '" + tocItem.getName() + "' in the document descriptor. IGNORING" ); continue; } String href = StringUtils.replace( tocItem.getRef(), "\\", "/" ); if ( href.lastIndexOf( "." ) != -1 ) { href = href.substring( 0, href.lastIndexOf( "." ) ); } for ( Iterator i = siteModuleManager.getSiteModules().iterator(); i.hasNext(); ) { SiteModule module = (SiteModule) i.next(); File moduleBasedir = new File( getBaseDir(), module.getSourceDirectory() ); if ( moduleBasedir.exists() ) { String doc = href + "." + module.getExtension(); File source = new File( moduleBasedir, doc ); // Velocity file? if ( !source.exists() ) { if ( href.indexOf( "." + module.getExtension() ) != -1 ) { doc = href + ".vm"; } else { doc = href + "." + module.getExtension() + ".vm"; } source = new File( moduleBasedir, doc ); } if ( source.exists() ) { String outputITextName = doc.substring( 0, doc.lastIndexOf( "." ) + 1 ) + "xml"; File outputITextFileTmp = new File( outputDirectory, outputITextName ); outputITextFileTmp.deleteOnExit(); if ( !outputITextFileTmp.getParentFile().exists() ) { outputITextFileTmp.getParentFile().mkdirs(); } iTextFiles.add( outputITextFileTmp ); parse( source, module, outputITextFileTmp, context ); } } } } return iTextFiles; } /** * @param logo * @param parentFile * @return the logo url or null if unable to create it. * @since 1.1.1 */ private String getLogoURL( String logo, File parentFile ) { if ( logo == null ) { return null; } try { return new URL( logo ).toString(); } catch ( MalformedURLException e ) { try { File f = new File( parentFile, logo ); if ( !f.exists() ) { getLogger().warn( "The logo " + f.getAbsolutePath() + " doesnt exist. IGNORING" ); } else { return f.toURI().toURL().toString(); } } catch ( MalformedURLException e1 ) { getLogger().debug( "Failed to convert to URL: " + logo, e1 ); } } return null; } } doxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/0000755000175000017500000000000011633153574032614 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoP0000644000175000017500000003041111250471607033215 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer.pdf.fo; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.io.Writer; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import javax.xml.transform.TransformerException; import org.apache.maven.doxia.docrenderer.DocumentRendererContext; import org.apache.maven.doxia.docrenderer.DocumentRendererException; import org.apache.maven.doxia.docrenderer.pdf.AbstractPdfRenderer; import org.apache.maven.doxia.document.DocumentModel; import org.apache.maven.doxia.document.DocumentTOC; import org.apache.maven.doxia.document.DocumentTOCItem; import org.apache.maven.doxia.module.fo.FoAggregateSink; import org.apache.maven.doxia.module.fo.FoSink; import org.apache.maven.doxia.module.fo.FoSinkFactory; import org.apache.maven.doxia.module.fo.FoUtils; import org.apache.maven.doxia.module.site.SiteModule; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.WriterFactory; import org.xml.sax.SAXParseException; /** * PDF renderer that uses Doxia's FO module. * * @author ltheussl * @version $Id: FoPdfRenderer.java 811653 2009-09-05 14:19:51Z vsiveton $ * @since 1.1 * @plexus.component role="org.apache.maven.doxia.docrenderer.pdf.PdfRenderer" role-hint="fo" */ public class FoPdfRenderer extends AbstractPdfRenderer { /** * {@inheritDoc} * @see org.apache.maven.doxia.module.fo.FoUtils#convertFO2PDF(File, File, String) */ public void generatePdf( File inputFile, File pdfFile ) throws DocumentRendererException { // Should take care of the document model for the metadata... generatePdf( inputFile, pdfFile, null ); } /** {@inheritDoc} */ public void render( Map filesToProcess, File outputDirectory, DocumentModel documentModel ) throws DocumentRendererException, IOException { render( filesToProcess, outputDirectory, documentModel, null ); } /** {@inheritDoc} */ public void render( Map filesToProcess, File outputDirectory, DocumentModel documentModel, DocumentRendererContext context ) throws DocumentRendererException, IOException { // copy resources, images, etc. copyResources( outputDirectory ); if ( documentModel == null ) { getLogger().debug( "No document model, generating all documents individually." ); renderIndividual( filesToProcess, outputDirectory, context ); return; } String outputName = getOutputName( documentModel ); File outputFOFile = new File( outputDirectory, outputName + ".fo" ); if ( !outputFOFile.getParentFile().exists() ) { outputFOFile.getParentFile().mkdirs(); } File pdfOutputFile = new File( outputDirectory, outputName + ".pdf" ); if ( !pdfOutputFile.getParentFile().exists() ) { pdfOutputFile.getParentFile().mkdirs(); } Writer writer = null; try { writer = WriterFactory.newXmlWriter( outputFOFile ); FoAggregateSink sink = new FoAggregateSink( writer ); File fOConfigFile = new File( outputDirectory, "pdf-config.xml" ); if ( fOConfigFile.exists() ) { sink.load( fOConfigFile ); getLogger().debug( "Loaded pdf config file: " + fOConfigFile.getAbsolutePath() ); } String generateTOC = ( context != null && context.get( "generateTOC" ) != null ? context.get( "generateTOC" ).toString().trim() : "start" ); int tocPosition = 0; if ( "start".equalsIgnoreCase( generateTOC )) { tocPosition = FoAggregateSink.TOC_START; } else if ( "end".equalsIgnoreCase( generateTOC )) { tocPosition = FoAggregateSink.TOC_END; } else { tocPosition = FoAggregateSink.TOC_NONE; } sink.setDocumentModel( documentModel, tocPosition ); sink.beginDocument(); sink.coverPage(); if ( tocPosition == FoAggregateSink.TOC_START ) { sink.toc(); } if ( ( documentModel.getToc() == null ) || ( documentModel.getToc().getItems() == null ) ) { getLogger().info( "No TOC is defined in the document descriptor. Merging all documents." ); mergeAllSources( filesToProcess, sink, context ); } else { getLogger().debug( "Using TOC defined in the document descriptor." ); mergeSourcesFromTOC( documentModel.getToc(), sink, context ); } if ( tocPosition == FoAggregateSink.TOC_END ) { sink.toc(); } sink.endDocument(); } finally { IOUtil.close( writer ); } generatePdf( outputFOFile, pdfOutputFile, documentModel ); } /** {@inheritDoc} */ public void renderIndividual( Map filesToProcess, File outputDirectory ) throws DocumentRendererException, IOException { renderIndividual( filesToProcess, outputDirectory, null ); } /** {@inheritDoc} */ public void renderIndividual( Map filesToProcess, File outputDirectory, DocumentRendererContext context ) throws DocumentRendererException, IOException { for ( Iterator j = filesToProcess.keySet().iterator(); j.hasNext(); ) { String key = (String) j.next(); SiteModule module = (SiteModule) filesToProcess.get( key ); File fullDoc = new File( getBaseDir(), module.getSourceDirectory() + File.separator + key ); String output = key; String lowerCaseExtension = module.getExtension().toLowerCase( Locale.ENGLISH ); if ( output.toLowerCase( Locale.ENGLISH ).indexOf( "." + lowerCaseExtension ) != -1 ) { output = output.substring( 0, output.toLowerCase( Locale.ENGLISH ).indexOf( "." + lowerCaseExtension ) ); } File outputFOFile = new File( outputDirectory, output + ".fo" ); if ( !outputFOFile.getParentFile().exists() ) { outputFOFile.getParentFile().mkdirs(); } File pdfOutputFile = new File( outputDirectory, output + ".pdf" ); if ( !pdfOutputFile.getParentFile().exists() ) { pdfOutputFile.getParentFile().mkdirs(); } FoSink sink = (FoSink) new FoSinkFactory().createSink( outputFOFile.getParentFile(), outputFOFile.getName() ); sink.beginDocument(); parse( fullDoc.getAbsolutePath(), module.getParserId(), sink, context ); sink.endDocument(); generatePdf( outputFOFile, pdfOutputFile, null ); } } private void mergeAllSources( Map filesToProcess, FoAggregateSink sink, DocumentRendererContext context ) throws DocumentRendererException, IOException { for ( Iterator j = filesToProcess.keySet().iterator(); j.hasNext(); ) { String key = (String) j.next(); SiteModule module = (SiteModule) filesToProcess.get( key ); sink.setDocumentName( key ); File fullDoc = new File( getBaseDir(), module.getSourceDirectory() + File.separator + key ); parse( fullDoc.getAbsolutePath(), module.getParserId(), sink, context ); } } private void mergeSourcesFromTOC( DocumentTOC toc, FoAggregateSink sink, DocumentRendererContext context ) throws IOException, DocumentRendererException { parseTocItems( toc.getItems(), sink, context ); } private void parseTocItems( List items, FoAggregateSink sink, DocumentRendererContext context ) throws IOException, DocumentRendererException { for ( Iterator k = items.iterator(); k.hasNext(); ) { DocumentTOCItem tocItem = (DocumentTOCItem) k.next(); if ( tocItem.getRef() == null ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "No ref defined for tocItem " + tocItem.getName() ); } continue; } String href = StringUtils.replace( tocItem.getRef(), "\\", "/" ); if ( href.lastIndexOf( "." ) != -1 ) { href = href.substring( 0, href.lastIndexOf( "." ) ); } renderModules( href, sink, tocItem, context ); if ( tocItem.getItems() != null ) { parseTocItems( tocItem.getItems(), sink, context ); } } } private void renderModules( String href, FoAggregateSink sink, DocumentTOCItem tocItem, DocumentRendererContext context ) throws DocumentRendererException, IOException { for ( Iterator i = siteModuleManager.getSiteModules().iterator(); i.hasNext(); ) { SiteModule module = (SiteModule) i.next(); File moduleBasedir = new File( getBaseDir(), module.getSourceDirectory() ); if ( moduleBasedir.exists() ) { String doc = href + "." + module.getExtension(); File source = new File( moduleBasedir, doc ); // Velocity file? if ( !source.exists() ) { if ( href.indexOf( "." + module.getExtension() ) != -1 ) { doc = href + ".vm"; } else { doc = href + "." + module.getExtension() + ".vm"; } source = new File( moduleBasedir, doc ); } if ( source.exists() ) { sink.setDocumentName( doc ); sink.setDocumentTitle( tocItem.getName() ); parse( source.getPath(), module.getParserId(), sink, context ); } } } } /** * @param inputFile * @param pdfFile * @param documentModel could be null * @throws DocumentRendererException if any * @since 1.1.1 */ private void generatePdf( File inputFile, File pdfFile, DocumentModel documentModel ) throws DocumentRendererException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Generating: " + pdfFile ); } try { FoUtils.convertFO2PDF( inputFile, pdfFile, null, documentModel ); } catch ( TransformerException e ) { if ( ( e.getCause() != null ) && ( e.getCause() instanceof SAXParseException ) ) { SAXParseException sax = (SAXParseException) e.getCause(); StringBuffer sb = new StringBuffer(); sb.append( "Error creating PDF from " ).append( inputFile.getAbsolutePath() ).append( ":" ) .append( sax.getLineNumber() ).append( ":" ).append( sax.getColumnNumber() ).append( "\n" ); sb.append( e.getMessage() ); throw new DocumentRendererException( sb.toString() ); } throw new DocumentRendererException( "Error creating PDF from " + inputFile + ": " + e.getMessage() ); } } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/PdfRenderer.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/PdfRen0000644000175000017500000000317411150516002033275 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer.pdf; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import org.apache.maven.doxia.docrenderer.DocumentRenderer; import org.apache.maven.doxia.docrenderer.DocumentRendererException; /** * PDF renderer interface. * * @author ltheussl * @version $Id: PdfRenderer.java 746998 2009-02-23 12:52:18Z vsiveton $ * @since 1.1 */ public interface PdfRenderer extends DocumentRenderer { /** Plexus lookup role. */ String ROLE = PdfRenderer.class.getName(); /** * Generate a final pdf ouput file from an intermediate format file. * * @param inputFile eg a fo or an itext file. * @param pdfFile the pdf file to generate. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any. */ void generatePdf( File inputFile, File pdfFile ) throws DocumentRendererException; } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/AbstractPdfRenderer.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/Abstra0000644000175000017500000000336411246714400033344 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer.pdf; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.util.Map; import org.apache.maven.doxia.docrenderer.AbstractDocumentRenderer; import org.apache.maven.doxia.docrenderer.DocumentRendererException; import org.apache.maven.doxia.document.DocumentModel; /** * Abstract pdf renderer, this doesn't depend on the framework. * * @author ltheussl * @version $Id: AbstractPdfRenderer.java 809520 2009-08-31 09:33:52Z vsiveton $ * @since 1.1 */ public abstract class AbstractPdfRenderer extends AbstractDocumentRenderer implements PdfRenderer { /** {@inheritDoc} */ public String getOutputExtension() { return "pdf"; } /** {@inheritDoc} */ public void render( Map filesToProcess, File outputDirectory, DocumentModel documentModel ) throws DocumentRendererException, IOException { render( filesToProcess, outputDirectory, documentModel, null ); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRenderer.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRe0000644000175000017500000001221411236037607033424 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.util.Collection; import org.apache.maven.doxia.document.DocumentModel; /** * Base interface for rendering documents from a set of input files. * * @author Vincent Siveton * @author ltheussl * @version $Id: DocumentRenderer.java 800802 2009-08-04 14:02:47Z vsiveton $ * @since 1.1 */ public interface DocumentRenderer { /** Plexus lookup role. */ String ROLE = DocumentRenderer.class.getName(); /** * Render a document from a set of files, depending on a rendering context. * * @param files the path name Strings (relative to a common base directory) * of files to include in the document generation. * @param outputDirectory the output directory where the document should be generated. * @param documentModel the document model, containing all the metadata, etc. * If the model contains a TOC, only the files found in this TOC are rendered, * otherwise all files from the Collection of files will be processed. * If the model is null, render all files individually. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any. * @throws java.io.IOException if any. */ void render( Collection files, File outputDirectory, DocumentModel documentModel ) throws DocumentRendererException, IOException; /** * Render a document from the files found in a source directory, depending on a rendering context. * * @param baseDirectory the directory containing the source files. * This should follow the standard Maven convention, ie containing all the site modules. * @param outputDirectory the output directory where the document should be generated. * @param documentModel the document model, containing all the metadata, etc. * If the model contains a TOC, only the files found in this TOC are rendered, * otherwise all files found under baseDirectory will be processed. * If the model is null, render all files from baseDirectory individually. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any // * @deprecated since 1.1.2, use {@link #render(File, File, DocumentModel, DocumentRendererContext)} */ void render( File baseDirectory, File outputDirectory, DocumentModel documentModel ) throws DocumentRendererException, IOException; // /** // * Render a document from the files found in a source directory, depending on a rendering context. // * // * @param baseDirectory the directory containing the source files. // * This should follow the standard Maven convention, ie containing all the site modules. // * @param outputDirectory the output directory where the document should be generated. // * @param documentModel the document model, containing all the metadata, etc. // * If the model contains a TOC, only the files found in this TOC are rendered, // * otherwise all files found under baseDirectory will be processed. // * If the model is null, render all files from baseDirectory individually. // * @param context the rendering context when processing files. // * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any // * @throws java.io.IOException if any // * @since 1.1.2 // */ // void render( File baseDirectory, File outputDirectory, DocumentModel documentModel, DocumentRendererContext context ) // throws DocumentRendererException, IOException; /** * Read a document model from a file. * * @param documentDescriptor a document descriptor file that contains the document model. * @return the document model, containing all the metadata, etc. * @throws org.apache.maven.doxia.docrenderer.DocumentRendererException if any * @throws java.io.IOException if any */ DocumentModel readDocumentModel( File documentDescriptor ) throws DocumentRendererException, IOException; /** * Get the output extension associated with this DocumentRenderer. * * @return the ouput extension. */ String getOutputExtension(); } doxia-sitetools-1.1.4/doxia-doc-renderer/src/main/javadoc/0000755000175000017500000000000011633153574023407 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/javadoc/org/0000755000175000017500000000000011633153574024176 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/javadoc/org/apache/0000755000175000017500000000000011633153574025417 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/javadoc/org/apache/maven/0000755000175000017500000000000011633153574026525 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/javadoc/org/apache/maven/doxia/0000755000175000017500000000000011633153574027631 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/javadoc/org/apache/maven/doxia/docrenderer/0000755000175000017500000000000011633153574032125 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/javadoc/org/apache/maven/doxia/docrenderer/itext/0000755000175000017500000000000011633153574033262 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/javadoc/org/apache/maven/doxia/docrenderer/itext/package.htmldoxia-sitetools-1.1.4/doxia-doc-renderer/src/main/javadoc/org/apache/maven/doxia/docrenderer/itext/p0000644000175000017500000000212711216135717033442 0ustar twernertwerner

DEPRECATED.

Since 1.1, the org.apache.maven.doxia.docrenderer.itext package is all deprecated and is unmaintained. It will be removed in the future. You could use an implementation of DocumentRenderer interface.

doxia-sitetools-1.1.4/doxia-doc-renderer/src/site/0000755000175000017500000000000011633153574022020 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/site/site.xml0000644000175000017500000000167211103331430023471 0ustar twernertwerner
doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/0000755000175000017500000000000011633153574022033 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/0000755000175000017500000000000011633153574024045 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/0000755000175000017500000000000011633153574025011 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/resources/0000755000175000017500000000000011633153574027023 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/resources/css/0000755000175000017500000000000011633153574027613 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/resources/css/site.css0000644000175000017500000000115710666117326031275 0ustar twernertwernera.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover { background: none; padding-right: 0; } body ul { list-style-type: square; } #downloadbox { float: right; margin-left: 2em; padding-left: 1em; padding-right: 1em; padding-bottom: 1em; border: 1px solid #999; background-color: #eee; width: 17.5em; } #downloadbox h5 { color: #000; margin: 0; border-bottom: 1px solid #aaaaaa; font-size: smaller; padding: 0; margin-top: 1em; } #downloadbox p { margin-top: 1em; margin-bottom: 0; } #downloadbox li { text-indent: inherit; } doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/resources/images/0000755000175000017500000000000011633153574030270 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/resources/images/architecture.odg0000644000175000017500000003073710666117326033457 0ustar twernertwernerPK f6.++mimetypeapplication/vnd.oasis.opendocument.graphicsPK f6Configurations2/statusbar/PK f6'Configurations2/accelerator/current.xmlPKPK f6Configurations2/floater/PK f6Configurations2/popupmenu/PK f6Configurations2/progressbar/PK f6Configurations2/menubar/PK f6Configurations2/toolbar/PK f6Configurations2/images/Bitmaps/PK f6 content.xmlZn6}W*,vb#"h@WZm6(PtlO/鐺:h3#37j\}^&yNX:rvi4b1I#/+6c 7b-Na!9sI>LQ󡈆,ie5Եjb%+jmukXhlR֭cRO2ד bII4rfBdC[,Ef|SpTesNVybYm߫t,->CJsk 6q Еiw#ȯuv=Ow9!ngJL0O0m$f;{݁P}6y۽᪈̚f3jҠ(v7t^qi//8k^Ѩ8K9 |4\,S."|AZ9wC4 j.Is3yBu@wGҢXJlp]Es^@suJίVoȉ3)&`nvN锣lFj9C\O-_ccoify  j봃(qZn 5rp6Pʠr&抺f]1a pJ8&fƌP/6z]P4lWp1+RVs%$ 2~ S2:TDB-hƖ~8HDtW\z?r9tlEcjosilm,lmѲl2XfmvD&dg1I,5q6x3SrlHm5࠲ K0ppEg=G&"Ybެf ` M#W~sFwIfL2 Ͷ v>R}W,ۗm@0vSY)PEp}ם:a9hacf4i <,l|/B;!qo#HPJzC/lP-b#꼫" f#zX#=rGwGW!d'dkj97jم8BE\&E.CٚCRfg b6T"ڨ4ϐH2EqFVii 鹽IX!aa{0sF5" 1R" IC,p|"9Jpݪ̅_{9!tcSHyIDՈ4~$ ?f7MP )v =bDlGuW9 ӌKYUV H9KWꁾ/Jѧq?:X|sYb@PB}}xЪIiF'ia=|Dki EIőJ']C:uLKU倜4D,Yg3e&FИ*g(Dy(6 7H2vkd&+UD4P1AΆͅqDT#͂ jP(6dу_> Œr.v6]#.4{ FVkCp]Pr$ڐs퇦MU]v_\yI^I-a^qH)6K}T*[]cuvyM4ɍ*aM^X?4#sxl#-{LRԎT1)ΏdycE"4=!B/!䏧/'Ch"ys:|^h>Bg'Dei=DW?V6y*27+:'RM**(ŒXcsW%8uTm$DA@hH .Sue0bK^ڻ*dw]J{gH+bj^?\CUiCJM..Q J*Zp ~˧8HWpLpǼ<¸g UJh3{~nf]KTaF7VSY{O|琈a+8[咆s^Cv;ګE;똤 61ZmwSnҨG2tׁ~׋Ah_u_ @^G5(=+ RBkQç8FaC4̞r_*btO4DQf:RW&zbꡮꡮFhO^W_Y*EKQu &:4]c?/Dsw{1:8H+e,x螨X-E|/ FycԱjڮq neL&K`c(R-Dm yU(Vh0Wv--xc*Z-6c/}keTW{㫙)we7ܳ12PF ( #Ó( dXj-W½@[ˊB@֒P~^lr:gT$(2*A|5\9-zkcݦ)r*]?($jhzיBLS&PK+ EPK f6meta.xmln0} rc`QRQ*u+b)6k`M؍V^U]P~96_78>{TAy2~= |Jtq@x_k ԶY#sاQYNҴDKQ}#nU֣0nE_ڃW{MʻǕd΢I\ T~ p`1t Vl-6ΰ|vS7 c n??PKhչBkPK f6Thumbnails/thumbnail.pngWy8&5!k }K2Y e2Q)42aP6c)&cɖO4C|d)kFRI!BX2(9?\w9oY\ьy;oMsI Ct<'yj!83h #$8&.(p*6hz1DYcbbq7|Yf8==ĕ>_+ܷYʭAA@SG򂀃mPK(؍ ( yW(mxbqGOaN[ҧH&"87la셅Ă؉^~CT.44$i`(((h }–hT*QyIi@ j.Vӗ9 Eagj0 LfKAT'v'A`ͨP*`ƐK>{AwĉcV] |zkr1dg8_= 웖%dM#zUK-82>*A!?~! qimPdWBӊ"4쾯DŋFx8|!v [~ןuC8}/%O;Lˠ܏]xG5[=ï8nW)跀e](H+8~& <L/F^ss㶗grmY]:˪U3?7 Gʛ9:<78R)ns-va(}:|7~8Bj;p2gҮ'?:\~oZAr{_Y%S|b d",7L]lS[wP* r+y[whd|rT:,e`"5p$;8nJtΤ'gbqL3#^0-1}C555nsJ;򏢻}h#Tk+!KFFO/k'GG6UM?DQEmiyBiT.^7sJU%5Ɲ 2+lVx|h+7dN7Rw&.!!AipT 'g҂rch6Uha&L+pfE_ș(?|?䡜&r/3|Z&=q_fd?M{Z2Is^b5W'I.5hϒ6nk1դR_tZU,(ᒖXc 'ל߂*!7.% Z}7ϭ+(Re OU/Q}LCc]=V6zrcbp2&(]HeWI[J,2l*}H r`ϣˡz{a߽^?h:ʅ-NJFY0^zd5Dhn@J d$.f ر5X|YW[ޞF_8]T iosf|P=_v=ڎ޴*ÜuGdjDA8\9E{5ʋ}y{x ]aޅ>SNm-wk,/ŖfX[A?/SG 9 ,Dz@RW7xfg#)޽0A e)t2ӥ',-g4]S9 ͨfEX[Y-IY'9m,XLB('ش5ՐЈd}V eŁWJ4{r瑤#Usz}8gSPq?|\A e#Csyr3%EhPFwuk~ TL{1~nOģ)jk4XeΪƠ6yg-?=#!.: |HWBL4:,B7_m[L)bvsm,sowWU7dYy2[D{f%Rj}&=.$D+Xy5OU2p9){ɋAcgo:6˰s*ArER jMxDQj sC!ϴu#37NV<H3O'l#\+΅ىM*jz^m:9$Hua*NDe[^s~'޲|"|>7n[̈́)m]Q15 %~RMr l{BttK1mxjٸ$(hj Ih%JKB0lg&zvӯֺُ`{!TVݑ'V̔Xw:WAүW0$R_-ĵz1 %ҨommmBhNxdz}Ƙ49 keޕg{}l"}8b>4yv[SgqҬXW_U9aZvK-moӠ3?R&Kx]s4,Lkv(n>~d{}yWĤV_]Slh.WZq}ז_li\6`e_#,3#N0VmCV \τG }R8'F`o2&`ңtn=imMزF'NT۹;^n'I(ރ(@2ZymM;*[Dh̬X [u[JSy3=|c'p>,cYkWfZ%pFגirkVߛ2cY9-嵈m}Χgl}yD1ǂ(n4@M%&0YUДӿ:}W]_& ͥ}X-gYQF芒Qz)xܞT @It-'JQI p_xY <=PKC( % PK f6 settings.xml[wH}E}={z{ۜS(N$Tq pWh잙 BU}[&6'/I8r]}"'vh W}ǯÃxneS/`JGm5*OJ6B/͜xEe۳oKbՓ94fEQR5l6Y⥀JFp{6Y'[Tqa-+quu>}+-63٦/teE~V4l+ſ0׵m&Jϼ1 D}b Wֽ\C z0[`Џ7vqL=+`;Ѯ{7FLC$?x}+Qz>"Ώ$AMdRNeCGӎK-ݗ.|i'dFxy.J 1rcyM&ZZ@oާHW_ RdfYsQ)1 0bftgr%-8gwûr':GУ ;'iceq5=Z%JݓZHQ.}ҔUHLC")cHtGB :SdžKqJI`gU,oϗ䁙 > sKn yэf`bױQE]״"[-s"?uĕEm^7:]82kXwR!@<9R y&[ƜjFܩ vG U+}Z:2+O HjJSaD5ԝ\5oFWbAb`> t9Z+`Vy+5"Q[X,o̦bTNxlL=25Z~.&MAև>-;V}>Vh3.@\ѭRJ ]Ә5'Ð_>#U^RjFvM @Po܄ƔH^HˎDecX JeiGݣH&k>A5Yaj.Y2Cg C@7=# Hd>)cawz1}=6`|xg= ď-,iDEU΂Z: >H ʥen4;Pxܝ8J{#oaASOEDP|mX1D>b4f.{! d{ސ`Xp`;F 'wHWO죺U>PVW.ţ.evv$lϣV >ˉ^ l=o0AR`ós5W?.Dqu+"gr |!m=CmT_y@syM9Bx.krlo$H=A?d:@Rm\/٪0eK6U.sawZʯfl~V=2o?۹=.WUVO[ \ ܰOuR@^Z B{GM*ø{<b+߁wnYWMijf<˃-Q@ psZOH*)o9I…9HHQa﫳*=^?O{E]zV$bT yb`yʝ뛣V4cՊą0$c.mʛwS<&Bϒ8b<(sT)i]EX|H!_Tʝz18{oIjN7IQׂpqr՛5\AkagMv@|6s-,2O\څ'.?PKANPK f6.++mimetypePK f6QConfigurations2/statusbar/PK f6'Configurations2/accelerator/current.xmlPK f6Configurations2/floater/PK f6Configurations2/popupmenu/PK f6NConfigurations2/progressbar/PK f6Configurations2/menubar/PK f6Configurations2/toolbar/PK f6Configurations2/images/Bitmaps/PK f6|Z) 1content.xmlPK f6+ E styles.xmlPK f6hչBk meta.xmlPK f6C( % Thumbnails/thumbnail.pngPK f6@a R 0settings.xmlPK f6ANW,META-INF/manifest.xmlPK-doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/resources/images/architecture.png0000644000175000017500000004617510666117326033475 0ustar twernertwernerPNG  IHDRU.^bKGD pHYsGtIME 1/"Y` IDATxe\{eni%ED1AlX㠘4*tw,,ϋD#p}?v}\.='Oz{Јׯ|GC zؘ^v>~xbX(1 FG"B z[zyyЕ>|x||<|bp8@+ A=@QQ1 1 b Fb FbJ?7ddd755 N<`AA?sٳ .ˏ77"""F@]|y̘1)荂ٳ3fHII)** Bp8N{/-0--m޽۶mM}MQQQQQQrrĉ_|:tPiiiW366V\\|Æ !!!荂?Ν;>} ƪU.^榢߾}[SSѣ!Cxlmm_`hhiӒRRRyB' VVV]_OxǏ/]t…VVVӧOO@oz>>>]YAA!((Ǐ]!m6ŋ۷ر#==}ƌQQQ'&%%/Fݾ}{Μ9ͻr d ) 7emmʟs̑X~͛7CWڽ{w[[[g 6l%K^xRgϞ=y򤋋Khh(61<<|͚5PWW9..NAAA[[ݻw._|رcǎ~}I$رcs̑\nݍ7g999EFFv}~==˗/gdd\vMGGŋ3hiixiii^r֭xx> ׯÖ FwrNNNwS.\n: &&fnnbŊKޜaaa$ԩS\.7"))IUU577777(44{t˖-G=z>֮Æi ]ЩS~W"Ǝ{޽s555!޾}bmm'?>==71""bС'NgϞoD"8pǦLLL:'!!{3!xջwJKK/^xƌ&Ls֯_w^~ׯ/\Ht̙3oݺk)Dw򓓓;y$DMгQ/}_:Nnjjp8Z6܌Mᵱ\.ɬ\.b/Ӈ0L&+fii [[[_K$7l؀xz=L||ѣy oO$vfJ6Y⼽d2YDDӇ0wݸqcG92~B6 dPOʝ>add~B(gϞ>--0,I=ظsNWWׂT(>hܹ3fXXXlܸ1<<>$)dhw]i``www  ڷo @NH3gd ={6<~ǎgΜ)))111OMMݺu+Ȑ!^^^P1w777c7b?D)))M<ӁԮ]<~xHR1z H(BdĉP.KNNMჩ]8b`g888@MΝ;x<bO`2XH$b;߼ysDDRL&ƍ_9koذALL+3^|S{v]]cǎݻ=k֬[޽48:M"%)o߆1Gcټ۷w:ڵk{مK%tuuv3sL)tO`aadr{{欯5o\QQBb2G=q=H444q㆖lbswwڛ7o]ZYYY&L?IKKNNNP1ڃ)**644`]ъ (K7D&7:z(Cv+YYYOOO??? l 111ͅўb.aÆAM}$}ꕽ;w>= C&%%AM~ʓ'OH$Nz=+:u*w}">h»@YY$?~|^^oL֭ xǏO=7ǡhCQ()))(b>|ԩSn)@022v횶6@o􏓞e(B2?G$HޮR6իc޽{ F,L&s߾}.϶m۠&mmϟ/??ڴi6mɁ)sR4 jBjjj<>Fƍի ?**7GX[[oٲQkiiQSSE IKKCYLΝt!@ذaÊ+[ Q 2!f?–-[8]d2_|9|-**ʤ#Fn#… UxWWWCoVׯ_gΜ A=<<0(M544jjjBT*@FF3% ;pz{?~Pի!C{(uuX(Bܼysvv6z455iiiUWW#>~(++ e8Ϝ9-UQQy葎z2!TxÇظA}z%d2׬YDb``,ԩS?~Minn~dWA=ex(QQFI+))=y0ӧy+V@AzѣGR QuttB¹rrrP^ҥK._ye˖AzX"\\\ C{1%%%wwwnmll\(Q F||<&HVVVP^>ݟ-onn (z]]],FEEE?|18pٳN?uԸqx@o|&++߿?d(pwwsiiĉ8b $j'O|||[ZZfdd@}`P_UU4{)))eFcǎ%Pt9^{P &lF:}} Xff|;Eӓߨӧ >>|e(Bh吡K=<||СC#FHOOe> ^{P]ƍd2ӏ=k(~ZCCr,໔;i؈ƍd2j^X"-[ ~[M$;r bB&'C{Npf%$$=F{aWwLу_f(6Uʔ{~ءC>?uRhhAV s?>x _RZZk.hWSScll\ZZLKKSVVŋ/uK=<ѣGhcǎ%HŶX,&bdi$$$(Jppp\\ŋ[ZZ/_~__߼<ebb[JII;w̙3D"N>aGFFz{{tgmmw^e/K.A 4-[ݻyׯ_GFFnڴihqㆯorrh42Ǎ8cƌ'zzz>}tذa<::޽{__'N<}Ç555ׯ_/((8s挏ObbѣG/I0cƌ/^ܻwKΝ;;(@O2ٸqҥKEDDzgee:OP'T@w܍#..071fO;ֶ(vO>W]]-쀡}/3т˅r:z5幹{AW,^nĉy˖-"}h@(@@_m|ͽ+K 꺸GksCç,G=9RUz*-V!6ذ3n5!'4F=deX[-^%F\B8~,]QF#$rkS}ʣ)&CfRE%B.V(H'E],g1q!zzg]E?\["$*!R.!2n2z@ _N3TB sXb:ΙXg;k.&%zz@obYNZ{фKF#&O^!$"!{&#mpإey1 1ۈ$2,Pӻ:G4Ԑ 懔"BHLZL5a K T+>++ ?a7huqб X[RA!d&PBPŤŤ/4jokae36JPv:Lr,:"$J5Y.xQ֩W EĥJvCUv bl6ë U%#4x5,5_=iyyx5 ͇IJ}tSPHTbl(rs]e}U B,}}f㜅ĤLf<oqk؟jI#*r z|? U-1uػ٩'(cm'6;a1Z_Y֦IQWť[jr^?h=dz홉_D(iYbol4g1@ yzFd6YUoHVғ1E$d;-QB{5+z5yOzzGEEHK{knn. 0bĈ+**v%O],Q2:z9UuM䟢=poH.wk-:nVOqXcX;tRv?k|?'г?uufaLx\WO p`RE wA^ zE674V5VUŇcjeY}e".:&#uΨ> :b3{z?PJ5 CV"T?7vBHUw~\.,}ЋK_SPe#^VP׳!2`UՖ"ZO1ͅ+HTJfJs]՛;XwxҊy{{:tR=mhhsrrrrrΜ9chhc4glNa,FGXPSۧ#Üm-yoٽxR)UPi޻G7"ytBRj!b15uB" ;54]ʃðt$i!ҼwXoȿgĖ-[={UUUpnnn]_xk [̬"'Qg^ڳdHaqiaqi=3; Uul$ަSO\.Ltff^]zUDBHLrƉv`M5ww Olr8ZQ)y!1I+36Aqج? '$&*&=kw[hѢEB.\i׋MMMGʕ+W~`1 :B,@",&$>k^þQЃɩ vTWm|}FN zMG!1)i%s{K?ƅ^0Kh3s5B٭S!I\]vfw" RtgCUa BF#^I^1#_!7+Dqcf]]W[^#* /Z… ΝS^^^_%s=}7%6=s?MKӎ܆,#b`$2eq%-Wxxz]3Q!Eĉ$ YeU]%N]T[d{\`r(I7"+$E_mT:q'AQ"dO;")B"d '8%H ͒!@ʫ S;ض6|!$@" ~Ov]< =]"[ vvsε馏ɏm!5+ Ar9fKcmKC LIk5q8l6Zs}U[K#˅A=݋*">qlduk,w7q/]gi0lO{-Mgij/OxqN㑎|xnᵅD%gvx=as + >p9% '}r8y$vՓ[I| [zky~܄%۰cz2~]LQ5)LEf$I~u({DK)uqBiq1!xĶs\}‹{tp]E(1a1"9}B9.Ǎ !TWQT>>;MU0!jZXv~ڼvq0 !%M #,&!y8!/6z>ADRVTR.)ꊨ26fVo2>>fq)OBbRbR-GLw1E\S`mEE)Shkk|ˁ0}|4rfl}e999aa۷+((zjĉt:}H=Jp ׮]1cƞ={Brrr'Nrƍ=<<ԬyϢP(AAAt:ÇCEq: "^jjj#BӧO߰aF |,^lYTT6)99944KTTgv]]ݙ3gʁާFL&BHPPÇDKK> &N())KZXX|rѢEÇLiiiazUF1SSS555MM'O'#WWWѣG=z'{ѕ+WJHH,Xɓl6xbinnА&VVVb,,,dٙ:vXXXܹs߿?iҤ3fLdd$F<|޼yN_ӪP^^bŊVnܸQ^^ȑ#B...X655A0MMMXiΝ***SL:t(B9xiw9{{zz޹sGLL477/&L|++ǏoذURR2##k! 7NQQqΝӦM밇f֭{INN޹sŋ ;="##O8]whyE9s ,$$}1tvtOUUu...I&L8b-[lwޥ+W$>}[?+W\reժUg>|ܹs z"u*]]ݬO\|>|B?Ju}_wRw;*L K~7oJoh9Y.^}{b]vo}z*::F9 ̛7/00y,--ޱOL>}Pԃo[vB( 666**Ky}<)===((+ٿgggggg۷@?.O׮]g""":ʕ+UnݺyR(̙3g޼yYQK400066<%(ٳϟ0 (U֬Yfcccp8O.@  bbZp,@o?ѱNmQA=]d2{č˻Lb7w CLϾ7"cgQ~[x"7 1 1 b Fb F@(@@o&=[Cui X@$ ?o6OP7`j+H"1>#G, 9dЙ :1s1?rWOnOxwM=?bѹi/(=^p~s꣛p87/4- DBӻ!Ӆť;,j(' ٸ'ݦNX!֒zks8u=)+ AdA!PINh ]2YuUcuB٩\.(땞%-Ê̴gťMByi/tP?>bdllw!&w,UDzʗϛOqvo㛆&Dzr{%ǫq ^xpi% .s~7O 5sZn7}vgggTO̠S­l6KQS!$& !T_Y\n('G xw~s4?/+uu6cO/H~y£!. J|dUBTaq岘,5!!E !T籧p03eO{8lQ =vuuu7o\bEOYaKK˾p 4, g*`1D2,(Js"D3h=){“Wsi/kmfA!Q.=gU8ȂB{RH%џ2pegg9sfgφ-2i^?do2UDݳ#JQW^د #mA^K&.۩idi/[:B`jy~㪽E^7zaNlr4-޹oV^#ɡ'wtkkmtho>.3VaF+AHV0xJZ<ߞrtU268͎xa̵_9SDBv]5E{Nˏ5陏y =YtW=K7H jR1)MuZómz EPxB8ϴ'~̈͛7ZZZ999P_*..!dkkѣgXyٻp9#؄a6 O rXLBHp* a5a1D2s\6rD@f2Il^f6f<8keOf2[%6\7yxrn{~:n׮]A555o޼A]z:YGεHF8Dt>3qO)p8,ExO>axo@/fO|D> ٳgP F߾}C&@p=lDϿz*QU<QU!!!_V(/_~{1 $::P F7|۝>b|C\\ܗ.YXXz F7| z FGw P% FiiiN:^?w XL&>tƚ}yr Fq;}f0l8QQQ(QQQ ԃ?QiiSϔ 1 tYYY+W:(  C ٸq# z QPTT:(QQ1 1  Fb Fb F@(@(QQ1 1 JuXkܾ}kST{{{(} B(&&fԨQ_AMM-??  A,,,ƌtuuJ@/P(_a̙P%`P&33SOOӇ޾}+)) Uzտ48p d(f͂zmYYYJ=]F@Ϟ=* AWa*++yFJJ *FA(++1d(,[vvv1 "37nQ}F #z!)B )yyycccp>>>PIJJ._JzyB @:ujHHno~ʿn"2zhgh41E ('gdd@ @(@v*))߿roUSSf͚.ohhh9rw{@E칫^WWd28jooqҥKdeethJJJrr)SBG!H]\ɜ N% 7z1)){! FQTTT]]f͚LPUUի󋋋O:zՊ+F⒛5XÆ =TYY5z5k|XSScggu֖Pmmh}}#>Fc0tswmٲE\\|ٲe ,k)))T*5&&,'$$`b2qqqs84}}ŋ-ZӧALL6##ٳRRRFFF'Oʚ7o޳g\\\Z[[ϟ?CDD_OOzĈ/V^^^NN.--MYYȈ WQQ177OII311 WTT:h`???4dȐG=xF]tI\\T FjEEŦ& ]NZZZ@@J.]ܹsP(YYY۷op8HH$gϞihh r IDAT t:]EE!$$$$''W]]V__]TPPPMMd2sss<țB ,XPZZzFMMÖ Nu떭(NEԴcSnܸ1lذ7oN1''ƍΝ۳gϗ>jԨP{{{ ;=FUUU JHHacy\.HTUU=wӧOcbbN81jԨUV=}4$$DXXΝ;1-?u1 &رɓ';vPPP0`7냂;w>11ߟ__~L&399Ԕ7QNNbOx`tt\\\?YfԔkii _߱co៯m۶MNNL&~۷oG]zuͪCeEEEsΕ8|EEի[[[ OQJOO744߿eeȜ9sZ[[iAAK߯JJJ.^nll=p@7o~zɒ%eeegVRR:thcc h4:LpB\\ŋz%cjތ3kz}9Y,\<ޥIz Fb Fb(@(@QۗmuVy' 7wPbbsTtpe=\ G5]IgsJBK ׷_KK-=@"njQ<;k,' Ӗ5D.~{,ol%KU Vb~l<{}I>T6|>-k$B7L5 M+|W=TXbq8n&DgXjE+J/C%T-TN")"rv;rSuIOUbq85ͼt&BB$Zh#[ m MQ軽Q&g20}ƍp8PSɪhk-%Dַ-+&N% 4?SVEǚGˊ3PIʯF]˞oao$ϾR+r8uA_>UMta?;Q@5Pq~A1zJuv1(mo+_\R6HLR_!D"+J|\.:" C4zPBa8jq8YAUIʫnn=kĜ6U"%%~*)S?aPRnlc6^T,Թ6An^MuqP`̻J{ R~0˪z7JS^_QBBpMt(LkgB2"Y4a L nheȉ vߪ O+|WZg!1 @ߍʦMrWlu~hlcl4eh]%ҭwS${n7ٕ i5D/'N$xsnή@rkm 4)ċzEWc=6EѵVvj2li3Fc7E1uBb5QSQS|66YfκΥ)sg=;#s&~׵g<)RavG6ڬ:D$bڥn^w23b)_ᔁ|0`Ur0hl#+=#w()Q= \lx:p0b#v6ߝ55K{%1 GSSY-n%z&p8~xA&F2 d@F2 @FQH7-Hx<$`fd21#z .o}>c"v;M,>egIENDB`doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/resources/images/doxia-logo.png0000644000175000017500000003776711213302435033046 0ustar twernertwernerPNG  IHDR,[ pHYsgRtIME :m> IDATx}WוWݷv@72@d ((f4c[Z?? ~ӲgF#IH!4bn*?o.;w:kպN A $H A $H A $H A $H ABZhL5$H OB8)4f5`8a AZ < *KNxA @$kpM qE Q $a (EQb5< A D!hO@d!i A 4B(.z-p ($H'JBLȯ4Ah.HD ,G$HA2{;Q< A !g;a A 9v#"z@ W 2J# $H Y>OaL0)G$HA|x=pB*o0H <1@X#5 $a׾ RH  >H Alݛ!e00H Xvz2Y $a,`tQ a A%{{B7k4a A e5: `)a AR uaRТ CG A #̚]'8C ` Ayb+2٢A  PYJ#La# $٨ z 5҂L+1kq=A/ ܧ}k ^ pH;F'a  ig>d~ m@@+6< A쁰~#,\ mˆW#_7r3F\u* OB1dbv V:8 )?]&m²?9@9V$lMK.FXZ+ )c<- AҕFHy^#OP^?g3AĽ0&ԁaa~B@ nYN7a{⽖: bn稴 ޘ$YAhXz}ZrA;_kiZ%8| %m{2O Ala{,X Qy"fK;#F;O~{~b8B A,=>$eiG N8Ǐ!qn^pේחgh"`C2!uB.C77 ؁p*xAS¢!# a#=8=@26z=|OZnHܠD1cBy"P >+#ʉڂ=H. 뷈nޫ =@ bO{=e# x&ôCq/@0<Zw*{m/RA( J\pǐJ0h !~)H{^n$%K:ea"} F=@1OxR&Op G!y$H @eIvhS-:qQ50H AqHrNAcy*2k/@/Vf@\a Aa2ymQcWx)3̵P H k2g-H 4:|_XgRC՜ss3  Z!$A#\>s_AZM:\sz|z5N@/蕪n¨*@(^&4TֻZCfId_yudRj>ۨZ~̌3ӋbgM "_K ~5<+u_0:fXqv*oO0M KP7ɗ $c[ ;ID<7.BHY 1CUeM4Ϊ83|5gPM1P,IhkAaIBw.>WҧՍq;@*nw\0L2 p(-YbxJ;zS9b` Y4m|Fڂ|L*3?^|sWCXY PZ=7x~hv B}~ {H?Q5A^LRySos^vIi~Y}BkE&P,PXuor@Bx~NxI VS2C}qzb~>mVQ`+[\0*O[z9:F4VaJtAaKDy13$!*5 -0w^e$ٱy}Fst:=izwOs q~:ޠZCbཫ\+H/p-sJeM Fܠ4,vZ H=k a^a7i_#-S*5Ck[D=c@8oPQϦl~rf?0 `!ǭ*7h=* 7F4` A@Ưz䡷K5tB׃Tz<=$EE Hh<jXK2V34Vu7@jZ=| x[T=<)+$'鉦apvF4D(i$5Z-5Mo DLnH4ߋp|ta+c<1HI CzcWߵ J:Hs,{Ƚ,ã4RSq-։ޅP, kvBj] _aH}}zS|&#5-j^kQ7G}) l@2l(]M WoqS}ג2'4~wBz>$9<1${>rj<oH:}lP0z~hp.' ! =HBSItk"Q\4qe,LGv$ ˅M&HHݠ/eIJ&N6 Wߠ,@bgU6t ښ}@Џ?)Eb3]ƣ>P[=V; Z]$K= N4@zv1,Q#L[o4WU|}-NJxFLElCtYBAOnSsLƆtka2eg1M ;Zy,f=, hMU*CbVsJd/ c1p<8TakgndNM-+a1B&~eIp n#Sq>j…fC(a*K xBILp{m[4=~R[fXjM;JxXGh}/nF;;Sb Ñ Xm;-HUBbgt1M-l`)ZA)  ;l,Q:-N)XgH lKf/`SJM1ƐM8ak$-:7h;z}:p1;B[{tAAKM?J ̳4(P2Ecj-2l{&2R |{0G3u,P#7չ tT3*3p2aESu: #ub[CHW=L}HIUW+OAPI]DYYL\+ tƥjWW;_M|ߒqx臤gm= K UgRlm᧋NݞtMRvh4чO!%$GʽGZD~^:|3*S]& js4H;=들8!5q%)҆ {`SUrrRw"HY3UPiu 6y1<{P3|xnQZ# D>(jMg eZVcu߳?6S h=~Z{ h4"?%"ݤla^$D$ Ð$Od`ϰIlM祉cEg(CERXCiXfF5[t ~1ޠơ|a ԚZCO:}DO1NUZWѼdr@(^k!BhJs d#ېi]:icl\h:{7}ԕCW1GxN_n7VaHYǽ45?v|G8bl^QR?Jɲ|I=swpݬ3{unuH,@PLp:Nӣ *Ï _@ZX/h3A# Tb %ºJ<o2 N,G){ܰboS{hf]ڛQB=Z ꫆0vЊD} mfpX@'*{FQ$|NаlT^Ɉ9ޛnxgi c>cރ^Ȓ7[@s)}@~j>+{w#FeA*c5 V{@;v7f٪F#T RkP $>z 6[pwDiZR~^`eD ik -42GUF{8w ,/@b )/`mСL&CF*O kև5+F?F.mxtRsUVU0WXMȦ;FT6!z>,$-EM:҈liEEzELj2C&ϼaϹUl\# $Mz _Q(s^ k Հ \( X29Vy!}"@xeǷGYIDAT[aI)hTpyVDHhVVd/kd#Fܸg'딖c4s!m7 jI1yν) 77{ͫ7W|+˹B]+ o҃`+{GƾzJ~'GГ9Vr=FHS/0븶w N)>=BgJ4tAzildf=܃OQY0z5goW=omv 9B2 ~C/CetU ,=B'EK@@w> >.+:EO ^#HW|'4u8U0rp`hE}gaYsKv Iyd_8b2]2[3dNC(@ثct)"lj}<[2PR{IaQSG\zJZ(3lʭL =B7:F6aιbCzȾ I|6WWh2{cg 5c0B3 ڳ^;$ћ򙬥 vPP[S6s#?p@6+ZR_4lveCy]%@cn=uHAn7lX)U=GV'a 5С/rDxLXt7,2?ɫEo)fAL#IO!,Pcjv&#/g D5=7 txǬi$iE*㹴 x/C% hߍ ىGP}L5A-ldЩ@(ity nl6[3Ϲ|meU͝W]E8p[e Y#>!=&>AHڇ%O.׆NA29|3lDꁰ_桯_%} [T*NfbNUAbbUi[~dWBun2ϳGk1i!=H/7l#j6X (. EH{`Z f]=gb52Ci~2(_2}B仫n@mSQt~bᴡGdjϊVuذ% 3Gh4Az H&Ew2^gB(,х&$~NA-*9@7B#O[/սn cB42= K框Ϣ$I)ﻧwV1B՞ַlP!1z]S֕ay3`$a3 fxf!<ڀd\RD;s63CUJ10 ۹u YޢGXqj2X95P12_k}׼hcڧ!iOs4ڢٶaHSƭ<²GBt34͇i!{m:]v*aHvBMԂgTz}N?'k`QHM1vR>@ i?[buމdd֬0i  SP-FgrZa j"*ӎ;1 &EN*C[Fgf3z ݔJq!)o>gУkᯮ>2Vkf8",ų-9? i7uPx0uP5qӖO@Mw qgoj/+ ɥ,5qЮ=c?!1-λTa?}\<B_Aٙh|4=~&½F,v0B:Ȏڟʺߺtb "% -iRg| [^'8Z.H)z0P贠I53;m3=E8:;H(?37 Aa_Rcc1h. Oaza>:OV| 6ߪB2$ʛ%]#RZ2 FMjt티y~n@ ƍ}e$s-pĎմPHZ}O f,B!Y' Vs 7C}mA!H O O>d%x)x^4N?FR{U1tXq*y%۹7>l*Εz| @$YHȨr,4❅U>z\B Ÿ!iL?s_֌5i/COLP =heNi L;@9#A:ȗn@2c9sI/l@hƎG8Zത{mx#棋7 E1%?߽Ȧxy@Xv wZ7 Yy"ĉ!y{iQ*AH 쯤`Myv)*RNS:CbN ~ߧ HbΝK{/>\[Ż& )mJwGFKZ1Iia3X KoGM6!^#9De$2šF^&<-_@wNNwT7ѳqpRPg 8QYgh8@fo>b = kx2DBhw_CҴ5A5H 3JO}^`8M.@ CB40=-HP[5|F,bHtc}ؗX< HY%vc]H Y+nOOPU~| 8]Bg/Hh=JK$>P iA؂ H?SW+ {poT'h$Ց M4_p!2ZE!xIDF JJV: l DC ԇm> L=[sc%ːR}9<{:Uq=taWhV )0(e%$1患 >Avuzai^MϒK9dN֝ɛdP(삳 q us8FXt w⯷f $mjBnMw[H׍ UdwH\)A3y{n'+u:~iTDZ|s,oG_T,zNct | gV+ * hgmZfKT_CZ=aPYc_5ЄZ$|`xJp7h2֩]ĻFla |Xg 溥 B3YHFѤ7suԗ2SvC^.6 !MDbLc8%ƲP/+Hn We>. 0(5,|'_oiPCTڟP1|$YU BY$jcGoS>7Mv`4;.>"ǟ $%7NMH€E< O  A\ϻ44oR ݆|q$] Zy%,,[$ULFb}ot #~gLyv#ԝؠܫCEW$u9E'%Zws߇;*5O \š! Vsc\hHEH a %JUS+TculԋaGAhw |I+N3F"H/H׶w!tk4x TS=  UϩLӄHt%^q/2"B + HjlBtQmR%fCq98cnsGzNʦ IQi5=-UJNLU_QxB꤃C/Ak)|}I)cʮF6Cf]~ZwfiGXg QMSR3q҇s)_sTԜMd0'2BWŸC}^8IF)ZtU$ZڀH8e2C T茩FEʇSgj{~/D|S.ϔM6F'g1! ˙v1&)u 0FVNIliAS3bs<+c[B#lsٴI3Md`m״5˼.p5op[~Isg2 "׾iʢc;м"\F>1*cW'N=Mޘrn| 0x$.>~&?C C;~oqc'$LhD-*|ՑM^R%}h~hs?O.uNiUiJ s.0K!.axsܑh;u<? \g,)fꈢФuZSژ!p k׮z~5T+Ci*"m ?q2d]e+æix guش{|~ϖ4YAv29g% __XS*pN؄oMZXChtMviSB!5,?X"E@Z$)Yjݺ The Xdoc format Lukas Theussl

An 'xdoc' is an XML document conforming to a small and simple set of tags. Xdoc was the primary documentation format in Maven 1, Maven 2 largely replaced this by Apt, but xdoc is still supported.

Historically, the xdoc format can be traced back to the Anakia format, as once used by the Apache Jakarta project.

The Maven 1 Xdoc plugin introduced a few additions to the Anakia format, they are highlighted in the plugin documentation.

The following is a sample XDoc document:

Page Title John Doe

Hi!

Subsection!

code line 1 code line 2
]]>

Doxia will produce <h2> and <h3> headings for <section> and <subsection> elements, respectively. It is therefore perfectly valid to put some sub-headings (<h4>, <h5>, <h6>) inside a subsection. For instance,

A subsubsection]]>

will produce:

The core doxia modules do not construct anchors from section/subsection names. If you want to reference a section, you have to provide an explicit anchor:

]]>

Note that this differs from previous behavior, where anchors were constructed from section/subsection names, replacing special characters by underscores. This behavior presents two shortcomings:

  • If two sections or subsections have identical names (within one source document), you will get an ambiguity when referencing them. Also the resulting html document will not be valid XHTML. For other output formats (eg pdf), it might even be impossible to generate the target document.
  • For long section titles, this leads to rather cumbersome anchor names.

If automatic anchor generation is desired for a particular output format, it should be implemented / overridden by the corresponding low-level Sink.

Doxia is currently not able to validate your xdoc files as no schema or DTD exists yet (however this is planned before the 1.0 release). It is therefore necessary to check manually whether your source files are valid xdocs, this should ensure that the generated html files are valid XHTML1-transitional.

Here is a list of common mistakes to be aware of:

Wrong:

Here's a list:
  • item 1
  • item 2
of things to do.

]]>

Correct:

Here's a list:

  • item 1
  • item 2

of things to do.

]]>

Typical block level elements are list elements, <table>, <source>, <div>, <p> and <pre>.

Wrong:

Downloads
]]>

Correct:

Downloads

]]>

Typical inline elements are <a>, <strong>, <code>, <font>, <br> and <img>.

The <title> element has to come before <author>.

Wrong:

The following command executes the program: java -jar CoolApp.jar

]]>

Correct:

The following command executes the program:

java -jar CoolApp.jar]]>

However, you may put <source> elements inside list items or table rows.

doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/xdoc/references/fml-format.xml0000644000175000017500000000520711136256600032651 0ustar twernertwerner The FML (FAQ Markup Language) format Lukas Theussl

An 'fml' is an XML document conforming to a small and simple set of tags. The format was first used in the Maven 1, version of the FAQ plugin.

The following is a sample FML document:

General What is Foo?

some markup goes here

some source code

some markup goes here

What is Bar?

some markup goes here

Installation How do I install Foo?

some markup goes here

]]>
doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/pdf.xml0000644000175000017500000000423711213437031026275 0ustar twernertwerner Apache Maven Doxia The Apache Maven Project Content generation framework Lightweight markup language APT FML XDOC Apache Maven Doxia Test v. 1.1.1-SNAPSHOT User Guide The Apache Software Foundation http://www.apache.org/images/asf_logo_wide.png ./images/doxia-logo.png doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/site.xml0000644000175000017500000000605111136256600026471 0ustar twernertwerner Doxia images/apache-maven-project-2.png images/maven-logo-2.gif org.apache.maven.skins maven-stylus-skin 1.0.1
doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/apt/0000755000175000017500000000000011633153574025575 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/apt/resources.apt0000644000175000017500000000352611014061503030302 0ustar twernertwerner ----- External Resources ----- Vincent Siveton ------ July 2007 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html External Resources *Articles *-----------+--------------+--------------+ || Title || Publisher || Author *-----------+--------------+--------------+ | {{{http://software.newsforge.com/article.pl?sid=04/04/16/1428219}Quick and dirty typesetting with APT}} | newsforge.com | Scott Nesbitt *-----------+--------------+--------------+ | {{{http://en.wikipedia.org/wiki/Lightweight_markup_language}Lightweight markup language}} | wikipedia.org | ? *-----------+--------------+--------------+ | {{{http://project.knowledgeforge.net/kforge/trac/wiki/TextProcessing}Simple (Ascii-Based) Text Formats}} | project.knowledgeforge.net | ? *-----------+--------------+--------------+ *Tools *-----------+--------------+ || Name || Author *-----------+--------------+ | {{{http://apteditor.sourceforge.net/}APT Editor (Eclipse plugin)}} | Mathieu Avoine *-----------+--------------+ doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/apt/index.apt0000644000175000017500000000456611014061503027404 0ustar twernertwerner ----- Doxia ----- Jason van Zyl Vincent Siveton ------ July 2007 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Maven Doxia Doxia is a content generation framework which aims to provide its users with powerful techniques for generating static and dynamic content: Doxia can be used in web-based publishing context to generate static sites, in addition to being incorporated into dynamic content generation systems like blogs, wikis and content management systems. Doxia supports markup languages with simple syntaxes. Lightweight markup languages are used by people who might be expected to read the document source as well as the rendered output. Doxia is used extensively by Maven and it powers the entire documentation system of Maven. It gives Maven the ability to take any document that Doxia supports and output it any format. * Brief History Based on the {{{http://www.xmlmind.com/aptconvert.html}Aptconvert}} project developed by {{{http://www.xmlmind.com/}Xmlmind}} company, Doxia was initially hosted by Codehaus, to become a sub-project of Maven early in 2006. * Main Features * Developed in Java * Support of several markup formats: APT (Almost Plain Text), Confluence, DocBook, FML (FAQ Markup Language), LaTeX, RTF, TWiki, XDoc (popular in Apache land), XHTML ~~ iText should be replaced by FOP * Easy to learn the syntax of the supported markup formats * Macro support * No need to have a corporate infrastructure (like wiki) to host your documentation * Extensible framework [] doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/apt/overview.apt0000644000175000017500000000717311014061503030140 0ustar twernertwerner ----- Overview Of The Doxia Framework ----- Vincent Siveton ------ July 2007 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Overview Of The Doxia Framework The following figure represents the main components of the Doxia Framework. [images/architecture.png] Doxia Framework <>: Just like Maven, Doxia uses {{{http://plexus.codehaus.org/}Plexus}} extensively. *Sink API The interface is a generic markup language interface. It contains several methods that encapsulate common text syntax. A start tag is denoted by method and a end of tag by method. For instance, you could do things like: ----- sink.paragraph(); sink.text( "my text" ); sink.paragraph_(); ----- similar to this HTML markup: -----

my text

----- To find out more about the Sink API, you could read the Javadoc {{{http://maven.apache.org/doxia/doxia-sink-api/apidocs/org/apache/maven/doxia/sink/Sink.html}here}}. *Doxia Core The is the API to parse a source and populate it in a object. The interface contains only one method: ----- void parse( Reader source, Sink sink ) throws ParseException; ----- The class has the responsibility to catch all parsing exceptions. It provides an helper method, , which helps to find where an error occurred. The class is an abstract implementation of the . It provides a macro mechanism to give dynamic functionalities for the parsing. For more information on macros, read the {{{./macros/index.html}Doxia Macro Guide}}. Finally, the interface is the last part of the puzzle. It provides main definitions of a given Doxia module and it is used by the site tools. *Doxia Modules A Doxia module is an implementation of a given markup language like APT or Xdoc. Each module should implement these interfaces: * interface, more specifically the class * interface [] Several modules provide also a implementation to handle a specific markup language. For more information on modules, read the {{{./modules/index.html}Doxia Module Guide}}. *Doxia Site Tools The are a collection of tools to renderer an output. The main tool used by Maven, specifically the {{{http://maven.apache.org/plugins/maven-site-plugin/}Maven Site Plugin}}, is the which renders in HTML any documents wrote with supported markup syntax. It used {{{http://velocity.apache.org/}Velocity templates}} to customize the renderer and the tool to decorate the renderer. This component describes the layout of the site defined in the file. The tool is used to renderer any document in another document. doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/fml/0000755000175000017500000000000011633153574025567 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/resources/site/fml/faq.fml0000644000175000017500000000532511215432700027026 0ustar twernertwerner How to handle style in the APT markup language?

APT doesn't currently support style. It is in the roadmap.

How to export in PDF?

An iText module exists using the iText XML document. Unfortunately, the iText team discontinued the XML to PDF functionalities.

A FOP module is currently in development in the Doxia sandbox. You can get the source here.

Is it possible to create a book?

Doxia also has a fairly simple tool for writing books. It comes complete with a Maven plugin to produce PDFs, LaTeX documents and Xdoc for direct integration in your Maven site.

The Doxia Book code is still in the Doxia sandbox, but it is fully functional allthough limited.

See Writing Books in Doxia for more information.

doxia-sitetools-1.1.4/doxia-doc-renderer/src/test/java/0000755000175000017500000000000011633153574022754 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/java/org/0000755000175000017500000000000011633153574023543 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/java/org/apache/0000755000175000017500000000000011633153574024764 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/java/org/apache/maven/0000755000175000017500000000000011633153574026072 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/java/org/apache/maven/doxia/0000755000175000017500000000000011633153574027176 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/java/org/apache/maven/doxia/docrenderer/0000755000175000017500000000000011633153574031472 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/java/org/apache/maven/doxia/docrenderer/DocumentRendererTest.javadoxia-sitetools-1.1.4/doxia-doc-renderer/src/test/java/org/apache/maven/doxia/docrenderer/DocumentRe0000644000175000017500000001126011213437031033445 0ustar twernertwernerpackage org.apache.maven.doxia.docrenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.util.Iterator; import java.util.List; import org.apache.maven.doxia.docrenderer.pdf.PdfRenderer; import org.apache.maven.doxia.document.DocumentModel; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; /** * @author Vincent Siveton * @version $Id: DocumentRendererTest.java 782949 2009-06-09 10:48:57Z vsiveton $ * @since 1.1.1 */ public class DocumentRendererTest extends PlexusTestCase { private PdfRenderer docRenderer; private File siteDirectoryFile; /** @throws java.lang.Exception */ protected void setUp() throws Exception { super.setUp(); siteDirectoryFile = getTestFile( "src/test/resources/site" ); } /** @throws java.lang.Exception */ protected void tearDown() throws Exception { release( docRenderer ); super.tearDown(); } /** @throws java.lang.Exception */ public void testFo() throws Exception { renderImpl( "fo" ); } /** @throws java.lang.Exception */ public void testFoAggregate() throws Exception { renderAggregatedImpl( "fo" ); } /** @throws java.lang.Exception */ public void testIText() throws Exception { renderImpl( "itext" ); } /** @throws java.lang.Exception */ public void testITextAggregate() throws Exception { renderAggregatedImpl( "itext" ); } private void renderImpl( String implementation ) throws Exception { File outputDirectory = getTestFile( "target/output/" + implementation ); if ( outputDirectory.exists() ) { FileUtils.deleteDirectory( outputDirectory ); } outputDirectory.mkdirs(); docRenderer = (PdfRenderer) lookup( PdfRenderer.ROLE, implementation ); assertNotNull( docRenderer ); docRenderer.render( siteDirectoryFile, outputDirectory, null ); List files = FileUtils.getFileNames( new File( siteDirectoryFile, "apt" ), "**/*.apt", FileUtils.getDefaultExcludesAsString(), false ); files.addAll( FileUtils.getFileNames( new File( siteDirectoryFile, "fml" ), "**/*.fml", FileUtils.getDefaultExcludesAsString(), false ) ); files.addAll( FileUtils.getFileNames( new File( siteDirectoryFile, "xdoc" ), "**/*.xml", FileUtils.getDefaultExcludesAsString(), false ) ); for ( Iterator it = files.iterator(); it.hasNext(); ) { String relativeFile = it.next().toString(); String relativePdf = StringUtils.replace( relativeFile, FileUtils.getExtension( relativeFile ), "pdf" ); File pdf = new File( outputDirectory, relativePdf ); assertTrue( pdf.exists() ); assertTrue( pdf.length() > 0 ); } } private void renderAggregatedImpl( String implementation ) throws Exception { File outputDirectory = getTestFile( "target/output/" + implementation + "-aggregated" ); if ( outputDirectory.exists() ) { FileUtils.deleteDirectory( outputDirectory ); } outputDirectory.mkdirs(); docRenderer = (PdfRenderer) lookup( PdfRenderer.ROLE, implementation ); assertNotNull( docRenderer ); DocumentModel descriptor = docRenderer.readDocumentModel( new File( siteDirectoryFile, "pdf.xml" ) ); assertNotNull( descriptor ); docRenderer.render( siteDirectoryFile, outputDirectory, descriptor ); File pdf = new File( outputDirectory, descriptor.getOutputName() + ".pdf" ); assertTrue( pdf.exists() ); assertTrue( pdf.length() > 0 ); } } doxia-sitetools-1.1.4/doxia-doc-renderer/pom.xml0000644000175000017500000001221311470564764021607 0ustar twernertwerner 4.0.0 doxia-sitetools org.apache.maven.doxia 1.1.4 ../pom.xml doxia-doc-renderer Doxia Sitetools :: Document Renderer Component The Document Renderer handles the rendering of documents, in formats like PDF and RTF. vsiveton Vincent Siveton vsiveton@apache.org Apache Software Foundation Java Developer -5 org.apache.maven.doxia doxia-core org.apache.maven.doxia doxia-logging-api org.apache.maven.doxia doxia-sink-api org.apache.maven.doxia doxia-module-itext ${doxiaVersion} org.apache.maven.doxia doxia-module-fo ${doxiaVersion} org.apache.maven.doxia doxia-module-apt org.apache.maven.doxia doxia-module-fml org.apache.maven.doxia doxia-module-xdoc org.apache.maven.doxia doxia-module-xhtml org.codehaus.plexus plexus-container-default org.codehaus.plexus plexus-utils org.codehaus.plexus plexus-velocity 1.1.7 commons-collections commons-collections org.codehaus.plexus plexus-component-api velocity velocity org.apache.velocity velocity 1.6.2 commons-collections commons-collections 3.2.1 com.lowagie itext 1.4 xalan xalan 2.7.0 xml-apis xml-apis 1.3.04 org.codehaus.plexus plexus-maven-plugin descriptor doxia-sitetools-1.1.4/doxia-decoration-model/0000755000175000017500000000000011633153572021137 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/0000755000175000017500000000000011633153572021726 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/0000755000175000017500000000000011633153572022652 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/0000755000175000017500000000000011633153572023573 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/0000755000175000017500000000000011633153572024362 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/0000755000175000017500000000000011633153572025603 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/0000755000175000017500000000000011633153572026711 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/0000755000175000017500000000000011633153572030015 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/0000755000175000017500000000000011633153572030761 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/0000755000175000017500000000000011633153572033110 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/doxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/in0000755000175000017500000000000011633153572033437 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritanceAssembler.javadoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/in0000644000175000017500000000407311136047124033436 0ustar twernertwernerpackage org.apache.maven.doxia.site.decoration.inheritance; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.doxia.site.decoration.DecorationModel; /** * Manage inheritance of the decoration model. * * @author Brett Porter * @version $Id: DecorationModelInheritanceAssembler.java 736602 2009-01-22 10:45:40Z vsiveton $ */ public interface DecorationModelInheritanceAssembler { /** Plexus lookup role. */ String ROLE = DecorationModelInheritanceAssembler.class.getName(); /** * Manage inheritance of the decoration model between a parent and child. * * @param name a name, used for breadcrumb. * @param child the child DecorationModel to be merged with parent. * @param parent the parent DecorationModel not null. * @param childBaseUrl the child base URL. * @param parentBaseUrl the parent base URL. */ void assembleModelInheritance( String name, DecorationModel child, DecorationModel parent, String childBaseUrl, String parentBaseUrl ); /** * Resolve relative paths for a DecorationModel given a base URL. * * @param decoration the DecorationModel. * @param baseUrl the base URL. */ void resolvePaths( DecorationModel decoration, String baseUrl ); } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.javadoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/in0000644000175000017500000003063411303554525033444 0ustar twernertwernerpackage org.apache.maven.doxia.site.decoration.inheritance; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.maven.doxia.site.decoration.Banner; import org.apache.maven.doxia.site.decoration.Body; import org.apache.maven.doxia.site.decoration.DecorationModel; import org.apache.maven.doxia.site.decoration.LinkItem; import org.apache.maven.doxia.site.decoration.Logo; import org.apache.maven.doxia.site.decoration.Menu; import org.apache.maven.doxia.site.decoration.MenuItem; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.Xpp3Dom; /** * Manage inheritance of the decoration model. * * @author Brett Porter * @author Henning P. Schmiedehausen * @version $Id: DefaultDecorationModelInheritanceAssembler.java 884677 2009-11-26 19:39:01Z hboutemy $ * @plexus.component role="org.apache.maven.doxia.site.decoration.inheritance.DecorationModelInheritanceAssembler" */ public class DefaultDecorationModelInheritanceAssembler implements DecorationModelInheritanceAssembler { /** {@inheritDoc} */ public void assembleModelInheritance( String name, DecorationModel child, DecorationModel parent, String childBaseUrl, String parentBaseUrl ) { URLContainer urlContainer = new URLContainer( parentBaseUrl, childBaseUrl ); // cannot inherit from null parent. if ( parent != null ) { if ( child.getBannerLeft() == null ) { child.setBannerLeft( parent.getBannerLeft() ); resolveBannerPaths( child.getBannerLeft(), urlContainer ); } if ( child.getBannerRight() == null ) { child.setBannerRight( parent.getBannerRight() ); resolveBannerPaths( child.getBannerRight(), urlContainer ); } if ( child.getPublishDate() == null ) { child.setPublishDate( parent.getPublishDate() ); } if ( child.getVersion() == null ) { child.setVersion( parent.getVersion() ); } if ( child.getSkin() == null ) { child.setSkin( parent.getSkin() ); } child.setPoweredBy( mergePoweredByLists( child.getPoweredBy(), parent.getPoweredBy(), urlContainer ) ); if ( parent.getLastModified() > child.getLastModified() ) { child.setLastModified( parent.getLastModified() ); } assembleBodyInheritance( name, child, parent, urlContainer ); assembleCustomInheritance( child, parent ); } } /** {@inheritDoc} */ public void resolvePaths( final DecorationModel decoration, final String baseUrl ) { URLContainer urlContainer = new URLContainer( null, baseUrl ); if ( decoration.getBannerLeft() != null ) { resolveBannerPaths( decoration.getBannerLeft(), urlContainer ); } if ( decoration.getBannerRight() != null ) { resolveBannerPaths( decoration.getBannerRight(), urlContainer ); } for ( Iterator i = decoration.getPoweredBy().iterator(); i.hasNext(); ) { Logo logo = (Logo) i.next(); resolveLogoPaths( logo, urlContainer ); } if ( decoration.getBody() != null ) { for ( Iterator i = decoration.getBody().getLinks().iterator(); i.hasNext(); ) { LinkItem linkItem = (LinkItem) i.next(); resolveLinkItemPaths( linkItem, urlContainer ); } for ( Iterator i = decoration.getBody().getBreadcrumbs().iterator(); i.hasNext(); ) { LinkItem linkItem = (LinkItem) i.next(); resolveLinkItemPaths( linkItem, urlContainer ); } for ( Iterator i = decoration.getBody().getMenus().iterator(); i.hasNext(); ) { Menu menu = (Menu) i.next(); resolveMenuPaths( menu.getItems(), urlContainer ); } } } /** * Resolves all relative paths between the elements in a banner. The banner element might contain relative paths * to the oldBaseUrl, these are changed to the newBannerUrl. * * @param banner * @param urlContainer */ private void resolveBannerPaths( final Banner banner, final URLContainer urlContainer ) { if ( banner != null ) { if ( StringUtils.isNotEmpty( banner.getHref() ) ) { banner.setHref( convertPath( banner.getHref(), urlContainer ) ); } if ( StringUtils.isNotEmpty( banner.getSrc() ) ) { banner.setSrc( convertPath( banner.getSrc(), urlContainer ) ); } } } private void assembleCustomInheritance( final DecorationModel child, final DecorationModel parent ) { if ( child.getCustom() == null ) { child.setCustom( parent.getCustom() ); } else { child.setCustom( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom) child.getCustom(), (Xpp3Dom) parent.getCustom() ) ); } } private void assembleBodyInheritance( final String name, final DecorationModel child, final DecorationModel parent, final URLContainer urlContainer ) { Body cBody = child.getBody(); Body pBody = parent.getBody(); if ( cBody != null || pBody != null ) { if ( cBody == null ) { cBody = new Body(); child.setBody( cBody ); } if ( pBody == null ) { pBody = new Body(); } if ( cBody.getHead() == null ) { cBody.setHead( pBody.getHead() ); } else { cBody.setHead( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom) cBody.getHead(), (Xpp3Dom) pBody.getHead() ) ); } cBody.setLinks( mergeLinkItemLists( cBody.getLinks(), pBody.getLinks(), urlContainer ) ); if ( cBody.getBreadcrumbs().isEmpty() && !pBody.getBreadcrumbs().isEmpty() ) { LinkItem breadcrumb = new LinkItem(); breadcrumb.setName( name ); breadcrumb.setHref( urlContainer.getNewPath() ); cBody.getBreadcrumbs().add( breadcrumb ); } cBody.setBreadcrumbs( mergeLinkItemLists( cBody.getBreadcrumbs(), pBody.getBreadcrumbs(), urlContainer ) ); cBody.setMenus( mergeMenus( cBody.getMenus(), pBody.getMenus(), urlContainer ) ); } } private List mergeMenus( final List childMenus, final List parentMenus, final URLContainer urlContainer ) { List menus = new ArrayList(); for ( Iterator it = childMenus.iterator(); it.hasNext(); ) { Menu menu = (Menu) it.next(); menus.add( menu ); } int topCounter = 0; for ( Iterator it = parentMenus.iterator(); it.hasNext(); ) { Menu menu = (Menu) it.next(); if ( "top".equals( menu.getInherit() ) ) { menus.add( topCounter, menu ); topCounter++; resolveMenuPaths( menu.getItems(), urlContainer ); } else if ( "bottom".equals( menu.getInherit() ) ) { menus.add( menu ); resolveMenuPaths( menu.getItems(), urlContainer ); } } return menus; } private void resolveMenuPaths( final List items, final URLContainer urlContainer ) { for ( Iterator i = items.iterator(); i.hasNext(); ) { MenuItem item = (MenuItem) i.next(); resolveLinkItemPaths( item, urlContainer ); resolveMenuPaths( item.getItems(), urlContainer ); } } private void resolveLinkItemPaths( final LinkItem item, final URLContainer urlContainer ) { if ( StringUtils.isNotEmpty( item.getHref() ) ) { String href = convertPath( item.getHref(), urlContainer ); if ( StringUtils.isNotEmpty( href ) ) { item.setHref( href ); } } else { item.setHref( convertPath( "", urlContainer ) ); } } private void resolveLogoPaths( final Logo logo, final URLContainer urlContainer ) { logo.setImg( convertPath( logo.getImg(), urlContainer ) ); resolveLinkItemPaths( logo, urlContainer ); } private List mergeLinkItemLists( final List childList, final List parentList, final URLContainer urlContainer ) { List items = new ArrayList(); for ( Iterator it = parentList.iterator(); it.hasNext(); ) { LinkItem item = (LinkItem) it.next(); resolveLinkItemPaths( item, urlContainer ); if ( !items.contains( item ) ) { items.add( item ); } } for ( Iterator it = childList.iterator(); it.hasNext(); ) { LinkItem item = (LinkItem) it.next(); if ( !items.contains( item ) ) { items.add( item ); } } return items; } private List mergePoweredByLists( final List childList, final List parentList, final URLContainer urlContainer ) { List logos = new ArrayList(); for ( Iterator it = parentList.iterator(); it.hasNext(); ) { Logo logo = (Logo) it.next(); if ( !logos.contains( logo ) ) { logos.add( logo ); } resolveLogoPaths( logo, urlContainer ); } for ( Iterator it = childList.iterator(); it.hasNext(); ) { Logo logo = (Logo) it.next(); if ( !logos.contains( logo ) ) { logos.add( logo ); } } return logos; } private String convertPath( final String relativePath, final URLContainer urlContainer ) { try { PathDescriptor oldPathDescriptor = new PathDescriptor( urlContainer.getOldPath(), relativePath ); PathDescriptor newPathDescriptor = new PathDescriptor( urlContainer.getNewPath(), "" ); PathDescriptor relativePathDescriptor = PathUtils.convertPath( oldPathDescriptor, newPathDescriptor ); return relativePathDescriptor.getLocation(); } catch ( MalformedURLException mue ) { throw new RuntimeException( "While converting Pathes:", mue ); } } /** * Contains an old and a new path. */ public final class URLContainer { private final String oldPath; private final String newPath; /** * Construct a URLContainer. * * @param oldPath the old path. * @param newPath the new path. */ public URLContainer( final String oldPath, final String newPath ) { this.oldPath = oldPath; this.newPath = newPath; } /** * Get the new path. * * @return the new path. */ public String getNewPath() { return this.newPath; } /** * Get the old path. * * @return the old path. */ public String getOldPath() { return this.oldPath; } } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtils.javadoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/in0000644000175000017500000001205711233333577033447 0ustar twernertwernerpackage org.apache.maven.doxia.site.decoration.inheritance; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.net.MalformedURLException; import java.net.URL; import org.codehaus.plexus.util.PathTool; /** * Utilities that allow conversion of old and new pathes and URLs relative to each other. * * @author Brett Porter * @author Henning P. Schmiedehausen * @version $Id: PathUtils.java 798148 2009-07-27 14:19:43Z ltheussl $ */ public abstract class PathUtils { /** * Private constructor. */ private PathUtils() { // do not instantiate } /** *

convertPath.

* * @param oldPath not null * @param newPath not null * @return a PathDescriptor converted by the new path * @throws java.net.MalformedURLException if any */ public static final PathDescriptor convertPath( final PathDescriptor oldPath, final PathDescriptor newPath ) throws MalformedURLException { String relative = getRelativePath( oldPath, newPath ); if ( relative == null ) { return oldPath; } return new PathDescriptor( relative ); } /** *

getRelativePath.

* * @param oldPathDescriptor not null * @param newPathDescriptor not null * @return a relative path depending if PathDescriptor is a file or a web url. * @see PathTool#getRelativeFilePath(String, String) * @see PathTool#getRelativeWebPath(String, String) */ public static final String getRelativePath( final PathDescriptor oldPathDescriptor, final PathDescriptor newPathDescriptor ) { // Cannot convert from URL to file. if ( oldPathDescriptor.isFile() ) { if ( !newPathDescriptor.isFile() ) { // We want to convert from a file to an URL. This is normally not possible... if ( oldPathDescriptor.isRelative() ) { // unless the old path is a relative path. Then we might convert an existing // site into a new URL using resolvePaths()... return oldPathDescriptor.getPath(); } // The old path is not relative. Bail out. return null; } else { // both are files, if either of them is relative, bail out // see DOXIASITETOOLS-29, MSITE-404, PLXUTILS-116 if ( oldPathDescriptor.isRelative() || newPathDescriptor.isRelative() ) { return null; } } } // Don't optimize to else. This might also be old.isFile && new.isFile ... if ( !oldPathDescriptor.isFile() ) { // URLs, determine if they share protocol and domain info URL oldUrl = oldPathDescriptor.getPathUrl(); URL newUrl = newPathDescriptor.getPathUrl(); if ( oldUrl == null || newUrl == null ) { // One of the sites has a strange URL. no relative path possible, bail out. return null; } if ( ( newUrl.getProtocol().equalsIgnoreCase( oldUrl.getProtocol() ) ) && ( newUrl.getHost().equalsIgnoreCase( oldUrl.getHost() ) ) && ( newUrl.getPort() == oldUrl.getPort() ) ) { // Both paths point to the same site. So we can use relative paths. String oldPath = oldPathDescriptor.getPath(); String newPath = newPathDescriptor.getPath(); return PathTool.getRelativeWebPath( newPath, oldPath ); } // Different sites. No relative Path possible. return null; } // Both Descriptors point to an absolute path. We can build a relative path. String oldPath = oldPathDescriptor.getPath(); String newPath = newPathDescriptor.getPath(); if ( oldPath == null || newPath == null ) { // One of the sites has a strange URL. no relative path possible, bail out. return null; } return PathTool.getRelativeFilePath( oldPath, newPath ); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptor.javadoxia-sitetools-1.1.4/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/in0000644000175000017500000001465011150515721033437 0ustar twernertwernerpackage org.apache.maven.doxia.site.decoration.inheritance; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.net.MalformedURLException; import java.net.URL; import org.codehaus.plexus.util.StringUtils; /** * This class holds an instance of a maven path. This consists of a relative path (e.g. images/maven-logo.png) and a * base reference which can also be a relative path (e.g. '.' or '../doxia') or an URL that is used for an absolute * anchor. * * @author Henning P. Schmiedehausen * @version $Id: PathDescriptor.java 746997 2009-02-23 12:51:29Z vsiveton $ */ public class PathDescriptor { private final URL baseUrl; private final URL pathUrl; private final String relativePath; /** * Construct a PathDescriptor from a path. * * @param path the path. * @throws java.net.MalformedURLException if a URL cannot be formed from the path. */ public PathDescriptor( final String path ) throws MalformedURLException { this( (URL) null, path ); } /** * Construct a PathDescriptor from a path and a base. * * @param base a base reference. * @param path the path. * @throws java.net.MalformedURLException if a URL cannot be formed from the path. */ public PathDescriptor( final String base, final String path ) throws MalformedURLException { this( PathDescriptor.buildBaseUrl( base ), path ); } /** * Construct a PathDescriptor from a path and a base. * * @param baseUrl a base reference. * @param path the path. * @throws java.net.MalformedURLException if a URL cannot be formed from the path. */ public PathDescriptor( final URL baseUrl, final String path ) throws MalformedURLException { this.baseUrl = baseUrl; URL pathURL = null; String relPath = null; try { pathURL = new URL( path ); } catch ( MalformedURLException e ) { try { pathURL = buildUrl( baseUrl, path ); } catch ( MalformedURLException e2 ) { // If we got an absolute path passed in and end here, then the path // is converted to relative because we have no reference URL anyway // to which it has been anchored. if ( path != null && path.startsWith( "/" ) ) { relPath = path.substring( 1 ); } else { relPath = path; } } } this.pathUrl = pathURL; this.relativePath = relPath; } private static URL buildBaseUrl( final String base ) throws MalformedURLException { if ( base == null ) { return null; } try { return new URL( base ); } catch ( MalformedURLException e ) { return new File( base ).toURI().toURL(); } } private static URL buildUrl( final URL baseUrl, final String path ) throws MalformedURLException { if ( baseUrl == null ) { throw new MalformedURLException( "Base is null!" ); } if ( path == null ) { return baseUrl; } if ( baseUrl.getProtocol().equals( "file" ) ) { return new File( baseUrl.getFile(), path ).toURI().toURL(); } if ( path.startsWith( "/" ) && baseUrl.getPath().endsWith( "/" ) ) { return new URL( baseUrl, path.substring( 1 ) ); } return new URL( baseUrl, path ); } /** * Check if this PathDescriptor decribes a file. * * @return true for file, false otherwise. */ public boolean isFile() { return isRelative() || pathUrl.getProtocol().equals( "file" ); } /** * Check if this PathDescriptor decribes a relative path. * * @return true if {@link #getPathUrl()} returns null. */ public boolean isRelative() { return pathUrl == null; } /** * Get the base URL. * * @return the base URL. */ public URL getBaseUrl() { return baseUrl; } /** * Get the path as a URL. * * @return the path as a URL. */ public URL getPathUrl() { return pathUrl; } /** * Get the path. * * @return the path. */ public String getPath() { if ( getPathUrl() != null ) { if ( isFile() ) { return StringUtils.stripEnd( getPathUrl().getPath(), "/" ); } else { return getPathUrl().getPath(); } } else { return relativePath; } } /** * Get the location for files. * * @return the location. */ public String getLocation() { if ( isFile() ) { if ( getPathUrl() != null ) { return StringUtils.stripEnd( getPathUrl().getFile(), "/" ); } else { return relativePath; } } else { return getPathUrl().toExternalForm(); } } /** {@inheritDoc} */ public String toString() { StringBuffer res = new StringBuffer( ( StringUtils.isNotEmpty( relativePath ) ) ? relativePath : String.valueOf( pathUrl ) ); res.append( " (Base: " ).append( baseUrl ).append( ") Location: " ).append( getLocation() ); return res.toString(); } } doxia-sitetools-1.1.4/doxia-decoration-model/src/main/mdo/0000755000175000017500000000000011633153572023431 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/main/mdo/decoration.mdo0000644000175000017500000005156211432044106026257 0ustar twernertwerner decoration Decoration This is a reference for the site decoration descriptor used in Doxia, also known as site.xml.

An XSD is available at:

]]>
package org.apache.maven.doxia.site.decoration DecorationModel <project>
element is the root of the site decoration descriptor. The following table lists all of the possible child elements. ]]> 1.0.0+ name The full name of the project. 1.0.0+ String true bannerLeft Banner logo on the masthead of the site to the left. 1.0.0+ Banner true bannerRight Banner logo on the masthead of the site to the right. 1.0.0+ Banner true publishDate Modify the date published display properties. 1.0.0+ PublishDate true version Modify the version published display properties. 1.0.0+ Version true poweredBy Powered by logos list. 1.0.0+ Logo * true skin The artifact containing the skin for the site. 1.0.0+ Skin true body The main site content decoration. 1.0.0+ Body true custom Custom configuration for use with customized Velocity templates. 1.0.0+ DOM true lastModified Timestamp of the last modification of this decoration model. 1.0.1+ long 1.0.0+ Banner Banner logo on the masthead of the site. 1.0.0+ name 1.0.0+ The name of the banner. String true src 1.0.0+ The source location of an image for the banner. String true alt 1.0.0+ The alt description for the banner image. String true href 1.0.0+ The href of a link to be used for the banner image. String true border The border to use for the banner image. 1.0.1+ String true width The width to use for the banner image. 1.0.1+ String true height The height to use for the banner image. 1.0.1+ String true PublishDate Modify display properties for date published. 1.0.0+ position Where to place the date published (left, right, navigation-top, navigation-bottom, bottom). 1.0.0+ String true format Date format to use. The default is ISO-8601 yyyy-MM-dd. 1.0.0+ String true yyyy-MM-dd Version Modify display properties for version published. 1.0.0+ position Where to place the version published (left, right, navigation-top, navigation-bottom, bottom). 1.0.0+ String true Logo Power by logo on the navigation. 1.0.0+ LinkItem Body The main content decoration. 1.0.0+ head Additional content (like Javascript) to include in the HEAD block of the generated pages. 1.0.0+ DOM true links A list of links to display in the navigation. 1.0.0+ LinkItem * true breadcrumbs A list of breadcrumbs to display in the navigation. 1.0.0+ LinkItem * true menus A list of menus to include in the navigation. 1.0.0+ Menu * true LinkItem A link in the navigation. 1.0.0+ name The name to display for the link. 1.0.0+ String true href The href to use for the link. 1.0.0+ String true img The source location of an image. 1.0.0+ String true position Where to place the image regarding the displayed name (left or right). 1.0.1+ String true left alt The alt to use for the image. 1.0.1+ String true border The border to use for the image. 1.0.1+ String true width The width to use for the image. 1.0.1+ String true height The height to use for the image. 1.0.1+ String true target Where the new document will be displayed when the user follows a link, i.e. _blank opens the new document in a new window. 1.0.1+ String true Menu A menu in the navigation. 1.0.0+ name The name to display for the menu. 1.0.0+ String true inherit top, bottom. ]]> 1.0.0+ String true inheritAsRef true means that it will be populated in the project, whereas if it is false, it is populated in the parent and then inherited. ]]> 1.0.0+ boolean ref reports, modules or parent. ]]> 1.0.0+ String true img The source location of an menu image. 1.0.0+ String true alt 1.0.1+ The alt description for the image. String true position Where to place the image regarding the displayed name (left or right). 1.0.1+ String true left border The border to use for the menu image. 1.0.1+ String true width The width to use for the menu image. 1.0.1+ String true height The height to use for the menu image. 1.0.1+ String true items A list of menu item. 1.0.0+ MenuItem * true MenuItem A menu item. 1.0.0+ LinkItem description A description of the menu item. This is used on any summary pages for a menu. 1.0.0+ String true collapse Whether to collapse children elements of an item menu (by default). 1.0.0+ boolean true ref A reference to a pre-defined menu item, such as a report (specified by the report goal name). Any elements explicitly given override those from the pre-defined reference. 1.0.0+ String true items A list of menu item. 1.0.0+ MenuItem * true Skin An skin artifact declaration. 1.0.0+ groupId The skin group ID. 1.0.0+ String true true artifactId The skin artifact ID. 1.0.0+ String true true version The skin version. 1.0.0+ String true 1.0.0+ org.apache.maven.skins:maven-default-skin. */ public static Skin getDefaultSkin() { Skin skin = new Skin(); skin.setGroupId( "org.apache.maven.skins" ); skin.setArtifactId( "maven-default-skin" ); skin.setVersion( "1.0" ); return skin; } ]]> doxia-sitetools-1.1.4/doxia-decoration-model/src/site/0000755000175000017500000000000011633153572022672 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/site/site.xml0000644000175000017500000000255311150046714024356 0ustar twernertwerner doxia-sitetools-1.1.4/doxia-decoration-model/src/site/apt/0000755000175000017500000000000011633153572023456 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/site/apt/using-decoration-xsd.apt0000644000175000017500000000272511140054174030227 0ustar twernertwerner ----- Using Schema Decoration 1.0 ----- Vincent Siveton ------ 2009-01-28 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Using Schema Decoration 1.0 The Decoration XSD is located {{{http://maven.apache.org/xsd/decoration-1.0.0.xsd}here}}. Your favorite IDE probably supports XSD schema's for site.xml files. You need to specify the following: +-----+ ... +-----+ doxia-sitetools-1.1.4/doxia-decoration-model/src/test/0000755000175000017500000000000011633153572022705 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/0000755000175000017500000000000011633153572024717 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/fully-populated-merged.xml0000644000175000017500000000342011136252543032023 0ustar twernertwerner name ../src ../href name ../src ../href org.apache.maven.skins maven-default-skin junk doxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/relative-urls-resolved.xml0000644000175000017500000000327711136252543032065 0ustar twernertwerner The Jakarta Project images/jakarta-logo.gif banner/left Jakarta Commons Sandbox commons/images/logo.png banner/right/ doxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/subsite-urls-file.xml0000644000175000017500000000364711136252543031025 0ustar twernertwerner The Jakarta Project file:///www/maven.apache.org/images/jakarta-logo.gif file:///www/maven.apache.org/banner/left Jakarta Commons Sandbox file:///www/maven.apache.org/commons/images/logo.png file:///www/maven.apache.org/banner/right/ doxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/external-urls.xml0000644000175000017500000000357011136252543030247 0ustar twernertwerner The Jakarta Project http://jakarta.apache.org/images/jakarta-logo.gif http://jakarta.apache.org/ Jakarta Commons Sandbox http://jakarta.apache.org/commons/images/logo.png http://jakarta.apache.org/commons/sandbox ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/subsite-relative-urls-multiple-resolved.xmldoxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/subsite-relative-urls-multiple-resol0000644000175000017500000000333011136252543034062 0ustar twernertwerner The Jakarta Project ../../images/jakarta-logo.gif ../left Jakarta Commons Sandbox ../../commons/images/logo.png doxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/subsite-urls.xml0000644000175000017500000000357711136252543030112 0ustar twernertwerner The Jakarta Project http://maven.apache.org/images/jakarta-logo.gif http://maven.apache.org/banner/left Jakarta Commons Sandbox http://maven.apache.org/commons/images/logo.png http://maven.apache.org/banner/right/ doxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/merged.xml0000644000175000017500000000476011303263222026677 0ustar twernertwerner The Jakarta Project http://jakarta.apache.org/ Jakarta Commons Sandbox http://jakarta.apache.org/commons/images/logo.png http://jakarta.apache.org/commons/sandbox org.apache.maven.skins maven-default-skin doxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/relative-urls.xml0000644000175000017500000000330411136252543030233 0ustar twernertwerner The Jakarta Project /images/jakarta-logo.gif banner/left Jakarta Commons Sandbox commons/images/logo.png /banner/right/ doxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/parent.xml0000644000175000017500000000444011303263222026720 0ustar twernertwerner The Jakarta Project http://jakarta.apache.org/ Jakarta Commons Sandbox http://jakarta.apache.org/commons/images/logo.png http://jakarta.apache.org/commons/sandbox org.apache.maven.skins maven-default-skin doxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/fully-populated-child.xml0000644000175000017500000000365311136252543031653 0ustar twernertwerner name src href name src href org.apache.maven.skins maven-default-skin junk doxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/subsite-relative-urls-resolved.xml0000644000175000017500000000333211136252543033531 0ustar twernertwerner The Jakarta Project ../images/jakarta-logo.gif ../banner/left Jakarta Commons Sandbox ../commons/images/logo.png ../banner/right/ doxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/child.xml0000644000175000017500000000247511136252543026530 0ustar twernertwerner doxia-sitetools-1.1.4/doxia-decoration-model/src/test/resources/empty.xml0000644000175000017500000000205611136252543026576 0ustar twernertwerner doxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/0000755000175000017500000000000011633153572023626 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/0000755000175000017500000000000011633153572024415 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/0000755000175000017500000000000011633153572025636 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/0000755000175000017500000000000011633153572026744 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/0000755000175000017500000000000011633153572030050 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/0000755000175000017500000000000011633153572031014 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/0000755000175000017500000000000011633153572033143 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/doxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/in0000755000175000017500000000000011633153572033472 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/Doxia91Test.javadoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/in0000644000175000017500000000444711233333423033474 0ustar twernertwernerpackage org.apache.maven.doxia.site.decoration.inheritance; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.TestCase; /** * Testcase for DOXIA-91 problems. All tests make sure that a passed in null will not generate any path conversion but * just returns the old path. * * @author Henning P. Schmiedehausen * @version $Id: Doxia91Test.java 798146 2009-07-27 14:17:55Z ltheussl $ */ public class Doxia91Test extends TestCase { /** @throws Exception */ public void testOldPathNull() throws Exception { PathDescriptor oldPath = new PathDescriptor( null ); PathDescriptor newPath = new PathDescriptor( "http://www.apache.org/" ); PathDescriptor diff = PathUtils.convertPath( oldPath, newPath ); assertEquals( diff, oldPath ); } /** @throws Exception */ public void testNewPathNull() throws Exception { PathDescriptor oldPath = new PathDescriptor( "http://www.apache.org/", "file:///home/henning/foo" ); PathDescriptor newPath = new PathDescriptor( null ); PathDescriptor diff = PathUtils.convertPath( oldPath, newPath ); assertEquals( diff, oldPath ); } /** @throws Exception */ public void testBothPathNull() throws Exception { PathDescriptor oldPath = new PathDescriptor( null ); PathDescriptor newPath = new PathDescriptor( null ); PathDescriptor diff = PathUtils.convertPath( oldPath, newPath ); assertEquals( diff, oldPath ); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.javadoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/in0000644000175000017500000000452211233333577033500 0ustar twernertwernerpackage org.apache.maven.doxia.site.decoration.inheritance; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import junit.framework.TestCase; /** * * @author ltheussl * @version $Id: PathUtilsTest.java 798148 2009-07-27 14:19:43Z ltheussl $ */ public class PathUtilsTest extends TestCase { private static final String SLASH = File.separator; /** @throws Exception */ public void testConvertPath() throws Exception { PathDescriptor oldPath = new PathDescriptor( (String) null, "base" ); PathDescriptor newPath = new PathDescriptor( "/tmp", "target" ); assertEquals( oldPath, PathUtils.convertPath( oldPath, newPath ) ); assertEquals( newPath, PathUtils.convertPath( newPath, oldPath ) ); } /** @throws Exception */ public void testGetRelativePath() throws Exception { PathDescriptor oldPath = new PathDescriptor( "/tmp/foo", "base" ); PathDescriptor newPath = new PathDescriptor( "/tmp", "target" ); assertEquals( ".." + SLASH + ".." + SLASH + "target", PathUtils.getRelativePath( oldPath, newPath ) ); oldPath = new PathDescriptor( (String) null, "base" ); assertNull( PathUtils.getRelativePath( oldPath, newPath ) ); assertNull( PathUtils.getRelativePath( newPath, oldPath ) ); oldPath = new PathDescriptor( "/tmp/foo", null ); assertEquals( ".." + SLASH + "target", PathUtils.getRelativePath( oldPath, newPath ) ); assertEquals( ".." + SLASH + "foo", PathUtils.getRelativePath( newPath, oldPath ) ); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptorTest.javadoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/in0000644000175000017500000005013711233333423033471 0ustar twernertwernerpackage org.apache.maven.doxia.site.decoration.inheritance; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.StringUtils; import junit.framework.TestCase; /** * Test the PathDescriptor creation under various circumstances. * * @author Henning P. Schmiedehausen * @version $Id: PathDescriptorTest.java 798146 2009-07-27 14:17:55Z ltheussl $ */ public class PathDescriptorTest extends TestCase { /** @throws Exception */ public void testAbsPath() throws Exception { String path = "absolutePath"; PathDescriptor desc = new PathDescriptor( "/" + path ); assertTrue( desc.isFile() ); assertTrue( desc.isRelative() ); assertNull( desc.getBaseUrl() ); assertNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", path, desc.getPath() ); assertEquals( "wrong location", path, desc.getLocation() ); } /** @throws Exception */ public void testRelPath() throws Exception { String path = "relativePath"; PathDescriptor desc = new PathDescriptor( path ); assertTrue( desc.isFile() ); assertTrue( desc.isRelative() ); assertNull( desc.getBaseUrl() ); assertNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", path, desc.getPath() ); assertEquals( "wrong location", path, desc.getLocation() ); } /** @throws Exception */ public void testEmptyAbsPath() throws Exception { String path = ""; PathDescriptor desc = new PathDescriptor( "/" + path ); assertTrue( desc.isFile() ); assertTrue( desc.isRelative() ); assertNull( desc.getBaseUrl() ); assertNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", path, desc.getPath() ); assertEquals( "wrong location", path, desc.getLocation() ); } /** @throws Exception */ public void testEmptyRelPath() throws Exception { String path = ""; PathDescriptor desc = new PathDescriptor( path ); assertTrue( desc.isFile() ); assertTrue( desc.isRelative() ); assertNull( desc.getBaseUrl() ); assertNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", path, desc.getPath() ); assertEquals( "wrong location", path, desc.getLocation() ); } /** @throws Exception */ public void testNullPath() throws Exception { String path = null; PathDescriptor desc = new PathDescriptor( path ); assertTrue( desc.isFile() ); assertTrue( desc.isRelative() ); assertNull( desc.getBaseUrl() ); assertNull( desc.getPathUrl() ); assertNull( desc.getPath() ); assertNull( desc.getLocation() ); assertEquals( "wrong path", path, desc.getPath() ); assertEquals( "wrong location", path, desc.getLocation() ); } /** @throws Exception */ public void testNullBaseAbsPath() throws Exception { String base = null; String path = "absolutePath"; PathDescriptor desc = new PathDescriptor( base, "/" + path ); assertTrue( desc.isFile() ); assertTrue( desc.isRelative() ); assertNull( desc.getBaseUrl() ); assertNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", path, desc.getPath() ); assertEquals( "wrong location", path, desc.getLocation() ); } /** @throws Exception */ public void testNullBaseRelPath() throws Exception { String base = null; String path = "relativePath"; PathDescriptor desc = new PathDescriptor( base, path ); assertTrue( desc.isFile() ); assertTrue( desc.isRelative() ); assertNull( desc.getBaseUrl() ); assertNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", path, desc.getPath() ); assertEquals( "wrong location", path, desc.getLocation() ); } /** @throws Exception */ public void testNullBaseEmptyAbsPath() throws Exception { String base = null; String path = ""; PathDescriptor desc = new PathDescriptor( base, "/" + path ); assertTrue( desc.isFile() ); assertTrue( desc.isRelative() ); assertNull( desc.getBaseUrl() ); assertNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", path, desc.getPath() ); assertEquals( "wrong location", path, desc.getLocation() ); } /** @throws Exception */ public void testNullBaseEmptyRelPath() throws Exception { String base = null; String path = ""; PathDescriptor desc = new PathDescriptor( base, path ); assertTrue( desc.isFile() ); assertTrue( desc.isRelative() ); assertNull( desc.getBaseUrl() ); assertNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", path, desc.getPath() ); assertEquals( "wrong location", path, desc.getLocation() ); } /** @throws Exception */ public void testNullBaseNullPath() throws Exception { String base = null; String path = null; PathDescriptor desc = new PathDescriptor( base, path ); assertTrue( desc.isFile() ); assertTrue( desc.isRelative() ); assertNull( desc.getBaseUrl() ); assertNull( desc.getPathUrl() ); assertNull( desc.getPath() ); assertNull( desc.getLocation() ); assertEquals( "wrong path", path, desc.getPath() ); assertEquals( "wrong location", path, desc.getLocation() ); } /** @throws Exception */ public void testUrlBaseAbsPath() throws Exception { String base = "http://maven.apache.org/"; String path = "absolutePath"; PathDescriptor desc = new PathDescriptor( base, "/" + path ); assertFalse( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", "/" + path, desc.getPath() ); assertEquals( "wrong location", base + path, desc.getLocation() ); } /** @throws Exception */ public void testUrlBaseRelPath() throws Exception { String base = "http://maven.apache.org/"; String path = "relativePath"; PathDescriptor desc = new PathDescriptor( base, path ); assertFalse( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", "/" + path, desc.getPath() ); assertEquals( "wrong location", base + path, desc.getLocation() ); } /** @throws Exception */ public void testUrlBaseEmptyAbsPath() throws Exception { String base = "http://maven.apache.org/"; String path = ""; PathDescriptor desc = new PathDescriptor( base, "/" + path ); assertFalse( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", "/" + path, desc.getPath() ); assertEquals( "wrong location", base + path, desc.getLocation() ); } /** @throws Exception */ public void testUrlBaseEmptyRelPath() throws Exception { String base = "http://maven.apache.org/"; String path = ""; PathDescriptor desc = new PathDescriptor( base, path ); assertFalse( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", "/" + path, desc.getPath() ); assertEquals( "wrong location", base + path, desc.getLocation() ); } /** @throws Exception */ public void testUrlBaseNullPath() throws Exception { String base = "http://maven.apache.org/"; String path = null; PathDescriptor desc = new PathDescriptor( base, path ); assertFalse( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", "/", desc.getPath() ); assertEquals( "wrong location", base, desc.getLocation() ); } /** @throws Exception */ public void testFileBaseAbsPath() throws Exception { String base = "/tmp/foo"; String path = "absolutePath"; PathDescriptor desc = new PathDescriptor( "file://" + base, "/" + path ); assertTrue( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { String s = StringUtils.replace( new File( base + "/" + path ).toURI().toURL().toString(), "file:", "" ); assertEquals( "wrong path", s, desc.getPath() ); assertEquals( "wrong location", s, desc.getLocation() ); } else { assertEquals( "wrong path", base + "/" + path, desc.getPath() ); assertEquals( "wrong location", base + "/" + path, desc.getLocation() ); } } /** @throws Exception */ public void testFileBaseRelPath() throws Exception { String base = "/tmp/foo"; String path = "relativePath"; PathDescriptor desc = new PathDescriptor( "file://" + base, path ); assertTrue( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { String s = StringUtils.replace( new File( base + "/" + path ).toURI().toURL().toString(), "file:", "" ); assertEquals( "wrong path", s, desc.getPath() ); assertEquals( "wrong location", s, desc.getLocation() ); } else { assertEquals( "wrong path", base + "/" + path, desc.getPath() ); assertEquals( "wrong location", base + "/" + path, desc.getLocation() ); } } /** @throws Exception */ public void testFileBaseEmptyAbsPath() throws Exception { String base = "/tmp/foo"; String path = ""; PathDescriptor desc = new PathDescriptor( "file://" + base, "/" + path ); assertTrue( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { String s = StringUtils.replace( new File( base ).toURI().toURL().toString(), "file:", "" ); assertEquals( "wrong path", s, desc.getPath() ); assertEquals( "wrong location", s, desc.getLocation() ); } else { assertEquals( "wrong path", base, desc.getPath() ); assertEquals( "wrong location", base, desc.getLocation() ); } } /** @throws Exception */ public void testFileBaseEmptyRelPath() throws Exception { String base = "/tmp/foo"; String path = ""; PathDescriptor desc = new PathDescriptor( "file://" + base, path ); assertTrue( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { String s = StringUtils.replace( new File( base ).toURI().toURL().toString(), "file:", "" ); assertEquals( "wrong path", s, desc.getPath() ); assertEquals( "wrong location", s, desc.getLocation() ); } else { assertEquals( "wrong path", base, desc.getPath() ); assertEquals( "wrong location", base, desc.getLocation() ); } } /** @throws Exception */ public void testFileBaseNullPath() throws Exception { String base = "/tmp/foo"; String path = null; PathDescriptor desc = new PathDescriptor( "file://" + base, path ); assertTrue( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( "wrong path", base, desc.getPath() ); assertEquals( "wrong location", base, desc.getLocation() ); } /** @throws Exception */ public void testPathBaseAbsPath() throws Exception { String base = "/tmp/foo"; String path = "absolutePath"; PathDescriptor desc = new PathDescriptor( base, "/" + path ); assertTrue( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { String s = StringUtils.replace( new File( base + "/" + path ).toURI().toURL().toString(), "file:", "" ); assertEquals( "wrong path", s, desc.getPath() ); assertEquals( "wrong location", s, desc.getLocation() ); } else { assertEquals( "wrong path", base + "/" + path, desc.getPath() ); assertEquals( "wrong location", base + "/" + path, desc.getLocation() ); } } /** @throws Exception */ public void testPathBaseRelPath() throws Exception { String base = "/tmp/foo"; String path = "relativePath"; PathDescriptor desc = new PathDescriptor( base, path ); assertTrue( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { String s = StringUtils.replace( new File( base + "/" + path ).toURI().toURL().toString(), "file:", "" ); assertEquals( "wrong path", s, desc.getPath() ); assertEquals( "wrong location", s, desc.getLocation() ); } else { assertEquals( "wrong path", base + "/" + path, desc.getPath() ); assertEquals( "wrong location", base + "/" + path, desc.getLocation() ); } } /** @throws Exception */ public void testPathBaseEmptyAbsPath() throws Exception { String base = "/tmp/foo"; String path = ""; PathDescriptor desc = new PathDescriptor( base, "/" + path ); assertTrue( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { String s = StringUtils.replace( new File( base ).toURI().toURL().toString(), "file:", "" ); assertEquals( "wrong path", s, desc.getPath() ); assertEquals( "wrong location", s, desc.getLocation() ); } else { assertEquals( "wrong path", base, desc.getPath() ); assertEquals( "wrong location", base, desc.getLocation() ); } } /** @throws Exception */ public void testPathBaseEmptyRelPath() throws Exception { String base = "/tmp/foo"; String path = ""; PathDescriptor desc = new PathDescriptor( base, path ); assertTrue( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { String s = StringUtils.replace( new File( base ).toURI().toURL().toString(), "file:", "" ); assertEquals( "wrong path", s, desc.getPath() ); assertEquals( "wrong location", s, desc.getLocation() ); } else { assertEquals( "wrong path", base, desc.getPath() ); assertEquals( "wrong location", base, desc.getLocation() ); } } /** @throws Exception */ public void testPathBaseNullPath() throws Exception { String base = "/tmp/foo"; String path = null; PathDescriptor desc = new PathDescriptor( base, path ); assertTrue( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { String s = StringUtils.replace( new File( base ).toURI().toURL().toString(), "file:", "" ); assertEquals( "wrong path", s, desc.getPath() ); assertEquals( "wrong location", s, desc.getLocation() ); } else { assertEquals( "wrong path", base, desc.getPath() ); assertEquals( "wrong location", base, desc.getLocation() ); } } /** @throws Exception */ public void testPathRelBase() throws Exception { String base = "../msite-404"; String path = "index.html"; PathDescriptor desc = new PathDescriptor( base, path ); assertTrue( desc.isFile() ); assertFalse( desc.isRelative() ); assertNotNull( desc.getBaseUrl() ); assertNotNull( desc.getPathUrl() ); assertNotNull( desc.getPath() ); assertNotNull( desc.getLocation() ); assertEquals( desc.getPath(), desc.getLocation() ); assertEquals( desc.getPathUrl().toString(), desc.getBaseUrl().toString() + "/" + path ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.javadoxia-sitetools-1.1.4/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/in0000644000175000017500000006140411233333423033470 0ustar twernertwernerpackage org.apache.maven.doxia.site.decoration.inheritance; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.IOException; import java.io.Reader; import junit.framework.TestCase; import org.apache.maven.doxia.site.decoration.Banner; import org.apache.maven.doxia.site.decoration.Body; import org.apache.maven.doxia.site.decoration.DecorationModel; import org.apache.maven.doxia.site.decoration.LinkItem; import org.apache.maven.doxia.site.decoration.Logo; import org.apache.maven.doxia.site.decoration.Menu; import org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Reader; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; /** * Test the inheritance assembler. * * @author Brett Porter * @version $Id: DecorationModelInheritenceAssemblerTest.java 798146 2009-07-27 14:17:55Z ltheussl $ */ public class DecorationModelInheritenceAssemblerTest extends TestCase { private DecorationModelInheritanceAssembler assembler = new DefaultDecorationModelInheritanceAssembler(); private static final String NAME = "Name"; /** @throws Exception */ public void testInheritence() throws IOException, XmlPullParserException { DecorationModel childModel = readModel( "child.xml" ); DecorationModel parentModel = readModel( "parent.xml" ); assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia", "http://maven.apache.org" ); DecorationModel mergedModel = readModel( "merged.xml" ); assertEquals( "Check result", mergedModel, childModel ); } public void testPathsResolvedWhenEmpty() throws IOException, XmlPullParserException { // Test an empty model avoids NPEs DecorationModel childModel = readModel( "empty.xml" ); DecorationModel parentModel = readModel( "empty.xml" ); assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia", "http://maven.apache.org" ); DecorationModel mergedModel = readModel( "empty.xml" ); assertEquals( "Check result", mergedModel, childModel ); } public void testPathsNotResolvedForExternalUrls() throws IOException, XmlPullParserException { DecorationModel parentModel = readModel( "external-urls.xml" ); DecorationModel childModel = readModel( "empty.xml" ); assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia", "http://maven.apache.org" ); assertEquals( "check left banner href", "http://jakarta.apache.org/", childModel.getBannerLeft().getHref() ); assertEquals( "check left banner image", "http://jakarta.apache.org/images/jakarta-logo.gif", childModel.getBannerLeft().getSrc() ); assertEquals( "check right banner href", "http://jakarta.apache.org/commons/sandbox", childModel.getBannerRight().getHref() ); assertEquals( "check right banner image", "http://jakarta.apache.org/commons/images/logo.png", childModel.getBannerRight().getSrc() ); Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 ); assertEquals( "check powered by logo href", "http://tomcat.apache.org/", poweredBy.getHref() ); assertEquals( "check powered by logo image", "http://tomcat.apache.org/logo.gif", poweredBy.getImg() ); LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 ); assertEquals( "check breadcrumb href", "http://www.apache.org/", breadcrumb.getHref() ); LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 ); assertEquals( "check link href", "http://www.bouncycastle.org", link.getHref() ); Menu menu = (Menu) childModel.getBody().getMenus().get( 0 ); LinkItem menuItem = (LinkItem) menu.getItems().get( 0 ); assertEquals( "check menu item href", "http://www.apache.org/special/", menuItem.getHref() ); } public void testPathsResolvedForRelativeUrls() throws IOException, XmlPullParserException { DecorationModel parentModel = readModel( "relative-urls.xml" ); DecorationModel childModel = readModel( "empty.xml" ); assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia/", "http://maven.apache.org" ); assertEquals( "check left banner href", "../banner/left", childModel.getBannerLeft().getHref() ); assertEquals( "check left banner image", "../images/jakarta-logo.gif", childModel.getBannerLeft().getSrc() ); assertEquals( "check right banner href", "../banner/right/", childModel.getBannerRight().getHref() ); assertEquals( "check right banner image", "../commons/images/logo.png", childModel.getBannerRight().getSrc() ); Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 ); assertEquals( "check powered by logo href", "../tomcat", poweredBy.getHref() ); assertEquals( "check powered by logo image", "../tomcat/logo.gif", poweredBy.getImg() ); LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 ); assertEquals( "check breadcrumb href", "../apache", breadcrumb.getHref() ); LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 ); assertEquals( "check link href", "../bouncycastle/", link.getHref() ); Menu menu = (Menu) childModel.getBody().getMenus().get( 0 ); LinkItem menuItem = (LinkItem) menu.getItems().get( 0 ); assertEquals( "check menu item href", "../special/", menuItem.getHref() ); } public void testPathsResolvedForSubsiteUrls() throws IOException, XmlPullParserException { DecorationModel parentModel = readModel( "subsite-urls.xml" ); DecorationModel childModel = readModel( "empty.xml" ); assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia/", "http://maven.apache.org" ); assertEquals( "check left banner href", "../banner/left", childModel.getBannerLeft().getHref() ); assertEquals( "check left banner image", "../images/jakarta-logo.gif", childModel.getBannerLeft().getSrc() ); assertEquals( "check right banner href", "../banner/right/", childModel.getBannerRight().getHref() ); assertEquals( "check right banner image", "../commons/images/logo.png", childModel.getBannerRight().getSrc() ); Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 ); assertEquals( "check powered by logo href", "../tomcat", poweredBy.getHref() ); assertEquals( "check powered by logo image", "../tomcat/logo.gif", poweredBy.getImg() ); LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 ); assertEquals( "check breadcrumb href", "../apache", breadcrumb.getHref() ); LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 ); assertEquals( "check link href", "../bouncycastle/", link.getHref() ); Menu menu = (Menu) childModel.getBody().getMenus().get( 0 ); LinkItem menuItem = (LinkItem) menu.getItems().get( 0 ); assertEquals( "check menu item href", "../special/", menuItem.getHref() ); } public void testPathsResolvedForRelativeUrlsDepthOfTwo() throws IOException, XmlPullParserException { DecorationModel parentModel = readModel( "relative-urls.xml" ); DecorationModel childModel = readModel( "empty.xml" ); assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia/core", "http://maven.apache.org" ); assertEquals( "check left banner href", "../../banner/left", childModel.getBannerLeft().getHref() ); assertEquals( "check left banner image", "../../images/jakarta-logo.gif", childModel.getBannerLeft().getSrc() ); assertEquals( "check right banner href", "../../banner/right/", childModel.getBannerRight().getHref() ); assertEquals( "check right banner image", "../../commons/images/logo.png", childModel.getBannerRight().getSrc() ); Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 ); assertEquals( "check powered by logo href", "../../tomcat", poweredBy.getHref() ); assertEquals( "check powered by logo image", "../../tomcat/logo.gif", poweredBy.getImg() ); LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 ); assertEquals( "check breadcrumb href", "../../apache", breadcrumb.getHref() ); LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 ); assertEquals( "check link href", "../../bouncycastle/", link.getHref() ); Menu menu = (Menu) childModel.getBody().getMenus().get( 0 ); LinkItem menuItem = (LinkItem) menu.getItems().get( 0 ); assertEquals( "check menu item href", "../../special/", menuItem.getHref() ); } public void testPathsResolvedForReverseRelativeUrls() throws IOException, XmlPullParserException { DecorationModel parentModel = readModel( "relative-urls.xml" ); DecorationModel childModel = readModel( "empty.xml" ); assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/", "http://maven.apache.org/doxia/" ); assertEquals( "check left banner href", "doxia/banner/left", childModel.getBannerLeft().getHref() ); assertEquals( "check left banner image", "doxia/images/jakarta-logo.gif", childModel.getBannerLeft().getSrc() ); assertEquals( "check right banner href", "doxia/banner/right/", childModel.getBannerRight().getHref() ); assertEquals( "check right banner image", "doxia/commons/images/logo.png", childModel.getBannerRight().getSrc() ); Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 ); assertEquals( "check powered by logo href", "doxia/tomcat", poweredBy.getHref() ); assertEquals( "check powered by logo image", "doxia/tomcat/logo.gif", poweredBy.getImg() ); LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 ); assertEquals( "check breadcrumb href", "doxia/apache", breadcrumb.getHref() ); LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 ); assertEquals( "check link href", "doxia/bouncycastle/", link.getHref() ); Menu menu = (Menu) childModel.getBody().getMenus().get( 0 ); LinkItem menuItem = (LinkItem) menu.getItems().get( 0 ); assertEquals( "check menu item href", "doxia/special/", menuItem.getHref() ); } public void testPathsResolvedForReverseRelativeUrlsDepthOfTwo() throws IOException, XmlPullParserException { DecorationModel parentModel = readModel( "relative-urls.xml" ); DecorationModel childModel = readModel( "empty.xml" ); assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/", "http://maven.apache.org/doxia/core/" ); assertEquals( "check left banner href", "doxia/core/banner/left", childModel.getBannerLeft().getHref() ); assertEquals( "check left banner image", "doxia/core/images/jakarta-logo.gif", childModel.getBannerLeft().getSrc() ); assertEquals( "check right banner href", "doxia/core/banner/right/", childModel.getBannerRight().getHref() ); assertEquals( "check right banner image", "doxia/core/commons/images/logo.png", childModel.getBannerRight().getSrc() ); Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 ); assertEquals( "check powered by logo href", "doxia/core/tomcat", poweredBy.getHref() ); assertEquals( "check powered by logo image", "doxia/core/tomcat/logo.gif", poweredBy.getImg() ); LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 ); assertEquals( "check breadcrumb href", "doxia/core/apache", breadcrumb.getHref() ); LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 ); assertEquals( "check link href", "doxia/core/bouncycastle/", link.getHref() ); Menu menu = (Menu) childModel.getBody().getMenus().get( 0 ); LinkItem menuItem = (LinkItem) menu.getItems().get( 0 ); assertEquals( "check menu item href", "doxia/core/special/", menuItem.getHref() ); } public void testPathsResolvedForUnrelatedRelativeUrls() throws IOException, XmlPullParserException { DecorationModel parentModel = readModel( "relative-urls.xml" ); DecorationModel childModel = readModel( "empty.xml" ); assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org", "http://jakarta.apache.org" ); assertEquals( "check left banner href", "http://jakarta.apache.org/banner/left", childModel.getBannerLeft().getHref() ); assertEquals( "check left banner image", "http://jakarta.apache.org/images/jakarta-logo.gif", childModel.getBannerLeft().getSrc() ); assertEquals( "check right banner href", "http://jakarta.apache.org/banner/right/", childModel.getBannerRight().getHref() ); assertEquals( "check right banner image", "http://jakarta.apache.org/commons/images/logo.png", childModel.getBannerRight().getSrc() ); Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 ); assertEquals( "check powered by logo href", "http://jakarta.apache.org/tomcat", poweredBy.getHref() ); assertEquals( "check powered by logo image", "http://jakarta.apache.org/tomcat/logo.gif", poweredBy.getImg() ); LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 ); assertEquals( "check breadcrumb href", "http://jakarta.apache.org/apache", breadcrumb.getHref() ); LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 ); assertEquals( "check link href", "http://jakarta.apache.org/bouncycastle/", link.getHref() ); Menu menu = (Menu) childModel.getBody().getMenus().get( 0 ); LinkItem menuItem = (LinkItem) menu.getItems().get( 0 ); assertEquals( "check menu item href", "http://jakarta.apache.org/special/", menuItem.getHref() ); } public void testNullParent() throws IOException, XmlPullParserException { DecorationModel childModel = readModel( "empty.xml" ); assembler.assembleModelInheritance( NAME, childModel, null, "http://maven.apache.org/doxia", "http://maven.apache.org" ); DecorationModel mergedModel = readModel( "empty.xml" ); assertEquals( "Check result", mergedModel, childModel ); } public void testFullyPopulatedChild() throws IOException, XmlPullParserException { DecorationModel childModel = readModel( "fully-populated-child.xml" ); DecorationModel parentModel = readModel( "fully-populated-child.xml" ); assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://foo.apache.org/doxia", "http://foo.apache.org" ); DecorationModel mergedModel = readModel( "fully-populated-child.xml" ); assertEquals( "Check result", mergedModel, childModel ); } public void testFullyPopulatedParentAndEmptyChild() throws IOException, XmlPullParserException { DecorationModel childModel = readModel( "empty.xml" ); DecorationModel parentModel = readModel( "fully-populated-child.xml" ); assembler.assembleModelInheritance( NAME, childModel, parentModel, "http://maven.apache.org/doxia", "http://maven.apache.org" ); DecorationModel mergedModel = readModel( "fully-populated-merged.xml" ); assertEquals( "Check result", mergedModel, childModel ); } public void testResolvingAllExternalUrls() throws IOException, XmlPullParserException { DecorationModel model = readModel( "external-urls.xml" ); assembler.resolvePaths( model, "http://foo.com/" ); DecorationModel mergedModel = readModel( "external-urls.xml" ); assertEquals( "Check result", mergedModel, model ); } public void testResolvingAllRelativeUrls() throws IOException, XmlPullParserException { DecorationModel model = readModel( "relative-urls.xml" ); assembler.resolvePaths( model, "http://foo.com/" ); DecorationModel resolvedModel = readModel( "relative-urls-resolved.xml" ); assertEquals( "Check result", resolvedModel, model ); } public void testResolvingAllSiteUrls() throws IOException, XmlPullParserException { DecorationModel model = readModel( "subsite-urls.xml" ); assembler.resolvePaths( model, "http://maven.apache.org/" ); DecorationModel resolvedModel = readModel( "relative-urls-resolved.xml" ); assertEquals( "Check result", resolvedModel, model ); } /* [MSITE-62] This is to test the ../ relative paths, which I am inclined not to use public void testResolvingAllSiteChildUrls() throws IOException, XmlPullParserException { DecorationModel model = readModel( "subsite-urls.xml" ); assembler.resolvePaths( model, "http://maven.apache.org/foo" ); DecorationModel resolvedModel = readModel( "subsite-relative-urls-resolved.xml" ); assertEquals( "Check result", resolvedModel, model ); } public void testResolvingAllSiteChildUrlsMultipleLevels() throws IOException, XmlPullParserException { DecorationModel model = readModel( "subsite-urls.xml" ); assembler.resolvePaths( model, "http://maven.apache.org/banner/right" ); DecorationModel resolvedModel = readModel( "subsite-relative-urls-multiple-resolved.xml" ); assertEquals( "Check result", resolvedModel, model ); } public void testResolvingAllSiteChildFilesystemUrls() throws IOException, XmlPullParserException { DecorationModel model = readModel( "subsite-urls-file.xml" ); assembler.resolvePaths( model, "file://localhost/www/maven.apache.org/foo" ); DecorationModel resolvedModel = readModel( "subsite-relative-urls-resolved.xml" ); assertEquals( "Check result", resolvedModel, model ); } */ public void testResolvingEmptyDescriptor() throws IOException, XmlPullParserException { DecorationModel model = readModel( "empty.xml" ); assembler.resolvePaths( model, "http://maven.apache.org" ); DecorationModel mergedModel = readModel( "empty.xml" ); assertEquals( "Check result", mergedModel, model ); } public void testDuplicateParentElements() { DecorationModel model = new DecorationModel(); model.setBody( new Body() ); model.getBody().addLink( createLinkItem( "Foo", "http://foo.apache.org" ) ); model.getBody().addLink( createLinkItem( "Foo", "http://foo.apache.org" ) ); model.addPoweredBy( createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ) ); model.addPoweredBy( createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ) ); DecorationModel child = new DecorationModel(); assembler.assembleModelInheritance( NAME, child, model, "http://maven.apache.org/doxia", "http://maven.apache.org" ); assertEquals( "Check size", 1, child.getBody().getLinks().size() ); assertEquals( "Check item", createLinkItem( "Foo", "http://foo.apache.org" ), child.getBody().getLinks().get( 0 ) ); assertEquals( "Check size", 1, child.getPoweredBy().size() ); assertEquals( "Check item", createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ), child.getPoweredBy().get( 0 ) ); } public void testDuplicateChildElements() { DecorationModel model = new DecorationModel(); model.setBody( new Body() ); model.getBody().addLink( createLinkItem( "Foo", "http://foo.apache.org" ) ); model.getBody().addLink( createLinkItem( "Foo", "http://foo.apache.org" ) ); model.addPoweredBy( createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ) ); model.addPoweredBy( createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ) ); DecorationModel parent = new DecorationModel(); assembler.assembleModelInheritance( NAME, model, parent, "http://maven.apache.org/doxia", "http://maven.apache.org" ); assertEquals( "Check size", 1, model.getBody().getLinks().size() ); assertEquals( "Check item", createLinkItem( "Foo", "http://foo.apache.org" ), model.getBody().getLinks().get( 0 ) ); assertEquals( "Check size", 1, model.getPoweredBy().size() ); assertEquals( "Check item", createLogo( "Foo", "http://foo.apache.org", "http://foo.apache.org/foo.jpg" ), model.getPoweredBy().get( 0 ) ); } public void testBreadcrumbWithoutHref() { DecorationModel model = new DecorationModel(); model.setBody( new Body() ); model.getBody().addBreadcrumb( createLinkItem( "Foo", null ) ); assembler.resolvePaths( model, "http://foo.apache.org" ); assertEquals( "Check size", 1, model.getBody().getBreadcrumbs().size() ); assertEquals( "Check item", createLinkItem( "Foo", "" ), model.getBody().getBreadcrumbs().get( 0 ) ); } public void testBannerWithoutHref() { DecorationModel model = new DecorationModel(); model.setBody( new Body() ); Banner banner = createBanner( "Left", null, "/images/src.gif", "alt" ); model.setBannerLeft( banner ); assembler.resolvePaths( model, "http://foo.apache.org" ); assertEquals( "Check banner", createBanner( "Left", null, "images/src.gif", "alt" ), model.getBannerLeft() ); } public void testLogoWithoutImage() { // This should actually be validated in the model, it doesn't really make sense DecorationModel model = new DecorationModel(); model.setBody( new Body() ); model.addPoweredBy( createLogo( "Foo", "http://foo.apache.org", null ) ); assembler.resolvePaths( model, "http://foo.apache.org" ); assertEquals( "Check size", 1, model.getPoweredBy().size() ); assertEquals( "Check item", createLogo( "Foo", "http://foo.apache.org", null ), model.getPoweredBy().get( 0 ) ); } private static Banner createBanner( String name, String href, String src, String alt ) { Banner banner = new Banner(); banner.setName( name ); banner.setHref( href ); banner.setSrc( src ); banner.setAlt( alt ); return banner; } private Logo createLogo( String name, String href, String img ) { Logo logo = new Logo(); logo.setHref( href ); logo.setImg( img ); logo.setName( name ); return logo; } private static LinkItem createLinkItem( String name, String href ) { LinkItem item = new LinkItem(); item.setName( name ); item.setHref( href ); return item; } private DecorationModel readModel( String name ) throws IOException, XmlPullParserException { Reader reader = null; try { reader = ReaderFactory.newXmlReader( getClass().getResourceAsStream( "/" + name ) ); return new DecorationXpp3Reader().read( reader ); } finally { IOUtil.close( reader ); } } } doxia-sitetools-1.1.4/doxia-decoration-model/pom.xml0000644000175000017500000000550511470564764022471 0ustar twernertwerner 4.0.0 doxia-sitetools org.apache.maven.doxia 1.1.4 ../pom.xml doxia-decoration-model Doxia Sitetools :: Decoration Model The Decoration Model handles the site descriptor, also known as site.xml. org.codehaus.plexus plexus-utils org.codehaus.modello modello-maven-plugin src/main/mdo/decoration.mdo 1.0.1 1.0.0 descriptor generate-sources xpp3-writer java xpp3-reader xsd descriptor-site pre-site xdoc xsd org.codehaus.plexus plexus-maven-plugin descriptor doxia-sitetools-1.1.4/doxia-site-renderer/0000755000175000017500000000000011633153574020464 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/0000755000175000017500000000000011633153574021253 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/0000755000175000017500000000000011633153574022177 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/0000755000175000017500000000000011633153574024211 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/site-renderer_pt_BR.properties0000644000175000017500000000156310553160323032160 0ustar twernertwerner# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. template.lastpublished=ltima atualizao template.version=Verso template.builtby=Construdo por doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/site-renderer_ja.properties0000644000175000017500000000161310553160323031540 0ustar twernertwerner# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. template.lastpublished=\u6700\u7d42\u66f4\u65b0 template.version=\u30d0\u30fc\u30b8\u30e7\u30f3 template.builtby=Built by doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/site-renderer_pl.properties0000644000175000017500000000154210553160323031562 0ustar twernertwerner# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. template.lastpublished=Ostatnio opublikowano template.builtby=Skompilowane przez doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/META-INF/0000755000175000017500000000000011633153574025351 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/META-INF/plexus/0000755000175000017500000000000011633153574026671 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/META-INF/plexus/components.xml0000644000175000017500000000617210657743271031612 0ustar twernertwerner org.codehaus.plexus.velocity.VelocityComponent doxia-default org.codehaus.plexus.velocity.DefaultVelocityComponent resource.loader classpath,site classpath.resource.loader.class org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader site.resource.loader.class org.codehaus.plexus.velocity.SiteResourceLoader runtime.log.invalid.references false velocimacro.messages.on false resource.manager.logwhenfound false velocimacro.permissions.allow.inline.to.replace.global true org.apache.maven.doxia.siterenderer.Renderer default org.apache.maven.doxia.siterenderer.DefaultSiteRenderer org.codehaus.plexus.velocity.VelocityComponent velocity doxia-default org.apache.maven.doxia.module.site.manager.SiteModuleManager siteModuleManager org.apache.maven.doxia.Doxia doxia org.codehaus.plexus.i18n.I18N i18n doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/site-renderer_it.properties0000644000175000017500000000156510553160323031570 0ustar twernertwerner# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. template.lastpublished=Ultima Pubblicazione template.version=Versione template.builtby=Costruito da doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/site-renderer_zh_CN.properties0000644000175000017500000000163310553160323032151 0ustar twernertwerner# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. template.builtby = \u6784\u5EFA\u4F9D\u9760 template.lastpublished = \u6700\u8FD1\u66F4\u65B0 template.version = \u7248\u672C doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/site-renderer_en.properties0000644000175000017500000000227511210467740031561 0ustar twernertwerner# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # NOTE: # This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It # must be provided nevertheless such that a request for locale "en" will not errorneously pick up the bundle for the # JVM's default locale (which need not be "en"). See the method javadoc about # ResourceBundle.getBundle(String, Locale, ClassLoader) # for a full description of the lookup strategy. doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/site-renderer.properties0000644000175000017500000000155210553160323031070 0ustar twernertwerner# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. template.lastpublished=Last Published template.version=Version template.builtby=Built by doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/0000755000175000017500000000000011633153574025000 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/0000755000175000017500000000000011633153574026221 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/0000755000175000017500000000000011633153574027327 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/0000755000175000017500000000000011633153574030433 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/0000755000175000017500000000000011633153574033126 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000755000175000017500000000000011633153574033640 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/css/doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000755000175000017500000000000011633153574033640 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/css/maven-base.cssdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000644000175000017500000000440711245746134033646 0ustar twernertwernerbody { margin: 0px; padding: 0px; } img { border:none; } table { padding:0px; width: 100%; margin-left: -2px; margin-right: -2px; } acronym { cursor: help; border-bottom: 1px dotted #feb; } table.bodyTable th, table.bodyTable td { padding: 2px 4px 2px 4px; vertical-align: top; } div.clear{ clear:both; visibility: hidden; } div.clear hr{ display: none; } #bannerLeft, #bannerRight { font-size: xx-large; font-weight: bold; } #bannerLeft img, #bannerRight img { margin: 0px; } .xleft, #bannerLeft img { float:left; } .xright, #bannerRight { float:right; } #banner { padding: 0px; } #banner img { border: none; } #breadcrumbs { padding: 3px 10px 3px 10px; } #leftColumn { width: 170px; float:left; overflow: auto; } #bodyColumn { margin-right: 1.5em; margin-left: 197px; } #legend { padding: 8px 0 8px 0; } #navcolumn { padding: 8px 4px 0 8px; } #navcolumn h5 { margin: 0; padding: 0; font-size: small; } #navcolumn ul { margin: 0; padding: 0; font-size: small; } #navcolumn li { list-style-type: none; background-image: none; background-repeat: no-repeat; background-position: 0 0.4em; padding-left: 16px; list-style-position: outside; line-height: 1.2em; font-size: smaller; } #navcolumn li.expanded { background-image: url(../images/expanded.gif); } #navcolumn li.collapsed { background-image: url(../images/collapsed.gif); } #poweredBy { text-align: center; } #navcolumn img { margin-top: 10px; margin-bottom: 3px; } #poweredBy img { display:block; margin: 20px 0 20px 17px; } #search img { margin: 0px; display: block; } #search #q, #search #btnG { border: 1px solid #999; margin-bottom:10px; } #search form { margin: 0px; } #lastPublished { font-size: x-small; } .navSection { margin-bottom: 2px; padding: 8px; } .navSectionHead { font-weight: bold; font-size: x-small; } .section { padding: 4px; } #footer { padding: 3px 10px 3px 10px; font-size: x-small; } #breadcrumbs { font-size: x-small; margin: 0pt; } .source { padding: 12px; margin: 1em 7px 1em 7px; } .source pre { margin: 0px; padding: 0px; } #navcolumn img.imageLink, .imageLink { padding-left: 0px; padding-bottom: 0px; padding-top: 0px; padding-right: 2px; border: 0px; margin: 0px; } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/css/print.cssdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000644000175000017500000000032710524215463033636 0ustar twernertwerner#banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn { display: none !important; } #bodyColumn, body.docs div.docs { margin: 0 !important; border: none !important } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/default-site.vmdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000644000175000017500000004172111430256655033646 0ustar twernertwerner #macro ( link $href $name $target $img $position $alt $border $width $height ) #set ( $linkTitle = ' title="' + $name + '"' ) #if( $target ) #set ( $linkTarget = ' target="' + $target + '"' ) #else #set ( $linkTarget = "" ) #end #if ( ( $href.toLowerCase().startsWith("http") || $href.toLowerCase().startsWith("https") ) ) #set ( $linkClass = ' class="externalLink"' ) #else #set ( $linkClass = "" ) #end #if ( $img ) #if ( $position == "left" ) #image($img $alt $border $width $height)$name #else $name #image($img $alt $border $width $height) #end #else $name #end #end ## #macro ( image $img $alt $border $width $height ) #if( $img ) #if ( ! ( $img.toLowerCase().startsWith("http") || $img.toLowerCase().startsWith("https") ) ) #set ( $imgSrc = $PathTool.calculateLink( $img, $relativePath ) ) #set ( $imgSrc = $imgSrc.replaceAll( '\\', '/' ) ) #set ( $imgSrc = ' src="' + $imgSrc + '"' ) #else #set ( $imgSrc = ' src="' + $img + '"' ) #end #if( $alt ) #set ( $imgAlt = ' alt="' + $alt + '"' ) #else #set ( $imgAlt = ' alt=""' ) #end #if( $border ) #set ( $imgBorder = ' border="' + $border + '"' ) #else #set ( $imgBorder = "" ) #end #if( $width ) #set ( $imgWidth = ' width="' + $width + '"' ) #else #set ( $imgWidth = "" ) #end #if( $height ) #set ( $imgHeight = ' height="' + $height + '"' ) #else #set ( $imgHeight = "" ) #end #end #end #macro ( banner $banner $id ) #if ( $banner ) #if( $banner.href ) #else #end #end #end ## #macro ( links $links ) #set ( $counter = 0 ) #foreach( $item in $links ) #set ( $counter = $counter + 1 ) #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) ) #set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) ) #link( $currentItemHref $item.name $item.target $item.img $item.position $item.alt $item.border $item.width $item.height ) #if ( $links.size() > $counter ) | #end #end #end ## #macro ( breadcrumbs $breadcrumbs ) #set ( $counter = 0 ) #foreach( $item in $breadcrumbs ) #set ( $counter = $counter + 1 ) #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) ) #set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) ) ## #if ( $currentItemHref == $alignedFileName || $currentItemHref == "" ) $item.name #else #link( $currentItemHref $item.name $item.target $item.img $item.position $item.alt $item.border $item.width $item.height ) #end #if ( $breadcrumbs.size() > $counter ) > #end #end #end ## #macro ( displayTree $display $item ) #if ( $item && $item.items && $item.items.size() > 0 ) #foreach( $subitem in $item.items ) #set ( $subitemHref = $PathTool.calculateLink( $subitem.href, $relativePath ) ) #set ( $subitemHref = $subitemHref.replaceAll( '\\', '/' ) ) #if ( $alignedFileName == $subitemHref ) #set ( $display = true ) #end ## #displayTree( $display $subitem ) #end #end #end ## #macro ( menuItem $item ) #set ( $collapse = "none" ) #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) ) #set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) ) ## #if ( $item && $item.items && $item.items.size() > 0 ) #if ( $item.collapse == false ) #set ( $collapse = "expanded" ) #else ## By default collapsed #set ( $collapse = "collapsed" ) #end ## #set ( $display = false ) #displayTree( $display $item ) ## #if ( $alignedFileName == $currentItemHref || $display ) #set ( $collapse = "expanded" ) #end #end
  • #if ( $item.img ) #if ( $item.position == "left" ) #if ( $alignedFileName == $currentItemHref ) #image($item.img $item.alt $item.border $item.width $item.height) $item.name #else #link($currentItemHref $item.name $item.target $item.img $item.position $item.alt $item.border $item.width $item.height) #end #else #if ( $alignedFileName == $currentItemHref ) $item.name #image($item.img $item.alt $item.border $item.width $item.height) #else #link($currentItemHref $item.name $item.target $item.img $item.position $item.alt $item.border $item.width $item.height) #end #end #else #if ( $alignedFileName == $currentItemHref ) $item.name #else #link( $currentItemHref $item.name $item.target $item.img $item.position $item.alt $item.border $item.width $item.height ) #end #end #if ( $item && $item.items && $item.items.size() > 0 ) #if ( $collapse == "expanded" )
      #foreach( $subitem in $item.items ) #menuItem( $subitem ) #end
    #end #end
  • #end ## #macro ( mainMenu $menus ) #foreach( $menu in $menus ) #if ( $menu.name ) #if ( $menu.img ) #if( $menu.position ) #set ( $position = $menu.position ) #else #set ( $position = "left" ) #end ## #if ( ! ( $menu.img.toLowerCase().startsWith("http") || $menu.img.toLowerCase().startsWith("https") ) ) #set ( $src = $PathTool.calculateLink( $menu.img, $relativePath ) ) #set ( $src = $src.replaceAll( '\\', '/' ) ) #set ( $src = ' src="' + $src + '"' ) #else #set ( $src = ' src="' + $menu.img + '"' ) #end ## #if( $menu.alt ) #set ( $alt = ' alt="' + $menu.alt + '"' ) #else #set ( $alt = ' alt="' + $menu.name + '"' ) #end ## #if( $menu.border ) #set ( $border = ' border="' + $menu.border + '"' ) #else #set ( $border = ' border="0"' ) #end ## #if( $menu.width ) #set ( $width = ' width="' + $menu.width + '"' ) #else #set ( $width = "" ) #end #if( $menu.height ) #set ( $height = ' height="' + $menu.height + '"' ) #else #set ( $height = "" ) #end ## #set ( $img = '" ) ## #if ( $position == "left" )
    $img $menu.name
    #else
    $menu.name $img
    #end #else
    $menu.name
    #end #end #if ( $menu.items && $menu.items.size() > 0 )
      #foreach( $item in $menu.items ) #menuItem( $item ) #end
    #end #end #end ## #macro ( copyright ) #if ( $project ) #if ( ${project.organization} && ${project.organization.name} ) #set ( $period = "" ) #else #set ( $period = "." ) #end ## #set ( $currentYear = ${currentDate.year} + 1900 ) ## #if ( ${project.inceptionYear} && ( ${project.inceptionYear} != ${currentYear.toString()} ) ) ${project.inceptionYear}-${currentYear}${period} #else ${currentYear}${period} #end ## #if ( ${project.organization} ) #if ( ${project.organization.name} && ${project.organization.url} ) ${project.organization.name}. #elseif ( ${project.organization.name} ) ${project.organization.name}. #end #end #end #end ## #macro ( publishDate $position $publishDate $version ) #if ( $publishDate && $publishDate.format ) #set ( $format = $publishDate.format ) #else #set ( $format = "yyyy-MM-dd" ) #end ## $dateFormat.applyPattern( $format ) ## #set ( $dateToday = $dateFormat.format( $currentDate ) ) ## #if ( $publishDate && $publishDate.position ) #set ( $datePosition = $publishDate.position ) #else #set ( $datePosition = "left" ) #end ## #if ( $version ) #if ( $version.position ) #set ( $versionPosition = $version.position ) #else #set ( $versionPosition = "left" ) #end #else #set ( $version = "" ) #set ( $versionPosition = "left" ) #end ## #set ( $breadcrumbs = $decoration.body.breadcrumbs ) #set ( $links = $decoration.body.links ) #if ( $datePosition.equalsIgnoreCase( "right" ) && $links && $links.size() > 0 ) #set ( $prefix = " |" ) #else #set ( $prefix = "" ) #end ## #if ( $datePosition.equalsIgnoreCase( $position ) ) #if ( ( $datePosition.equalsIgnoreCase( "right" ) ) || ( $datePosition.equalsIgnoreCase( "bottom" ) ) ) $prefix $i18n.getString( "site-renderer", $locale, "template.lastpublished" ): $dateToday #if ( $versionPosition.equalsIgnoreCase( $position ) )  | $i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version} #end #elseif ( ( $datePosition.equalsIgnoreCase( "navigation-bottom" ) ) || ( $datePosition.equalsIgnoreCase( "navigation-top" ) ) )
    $i18n.getString( "site-renderer", $locale, "template.lastpublished" ): $dateToday #if ( $versionPosition.equalsIgnoreCase( $position ) )  | $i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version} #end
    #elseif ( $datePosition.equalsIgnoreCase("left") )
    $i18n.getString( "site-renderer", $locale, "template.lastpublished" ): $dateToday #if ( $versionPosition.equalsIgnoreCase( $position ) )  | $i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version} #end #if ( $breadcrumbs && $breadcrumbs.size() > 0 ) | #breadcrumbs( $breadcrumbs ) #end
    #end #elseif ( $versionPosition.equalsIgnoreCase( $position ) ) #if ( ( $versionPosition.equalsIgnoreCase( "right" ) ) || ( $versionPosition.equalsIgnoreCase( "bottom" ) ) ) $prefix $i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version} #elseif ( ( $versionPosition.equalsIgnoreCase( "navigation-bottom" ) ) || ( $versionPosition.equalsIgnoreCase( "navigation-top" ) ) )
    $i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}
    #elseif ( $versionPosition.equalsIgnoreCase("left") )
    $i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version} #if ( $breadcrumbs && $breadcrumbs.size() > 0 ) | #breadcrumbs( $breadcrumbs ) #end
    #end #elseif ( $position.equalsIgnoreCase( "left" ) ) #if ( $breadcrumbs && $breadcrumbs.size() > 0 )
    #breadcrumbs( $breadcrumbs )
    #end #end #end ## #macro ( poweredByLogo $poweredBy ) #if( $poweredBy ) #foreach ($item in $poweredBy) #if( $item.href ) #set ( $href = $PathTool.calculateLink( $item.href, $relativePath ) ) #set ( $href = $href.replaceAll( '\\', '/' ) ) #else #set ( $href="http://maven.apache.org/" ) #end ## #if( $item.name ) #set ( $name = $item.name ) #else #set ( $name = $i18n.getString( "site-renderer", $locale, "template.builtby" ) ) #set ( $name = "${name} Maven" ) #end ## #if( $item.img ) #set ( $img = $item.img ) #else #set ( $img = "images/logos/maven-feather.png" ) #end ## #if ( ! ( $img.toLowerCase().startsWith("http") || $img.toLowerCase().startsWith("https") ) ) #set ( $img = $PathTool.calculateLink( $img, $relativePath ) ) #set ( $img = $src.replaceAll( '\\', '/' ) ) #end ## #if( $item.alt ) #set ( $alt = ' alt="' + $item.alt + '"' ) #else #set ( $alt = ' alt="' + $name + '"' ) #end ## #if( $item.border ) #set ( $border = ' border="' + $item.border + '"' ) #else #set ( $border = "" ) #end ## #if( $item.width ) #set ( $width = ' width="' + $item.width + '"' ) #else #set ( $width = "" ) #end #if( $item.height ) #set ( $height = ' height="' + $item.height + '"' ) #else #set ( $height = "" ) #end ## #end #if( $poweredBy.isEmpty() ) $i18n.getString( #end #else $i18n.getString( #end #end ## $title #foreach( $author in $authors ) #end #if ( $dateCreation ) #end #if ( $dateRevision ) #end #if ( $locale ) #end #if ( $decoration.body.head ) #foreach( $item in $decoration.body.head.getChildren() ) ## Workaround for DOXIA-150 due to a non-desired behaviour in p-u ## @see org.codehaus.plexus.util.xml.Xpp3Dom#toString() ## @see org.codehaus.plexus.util.xml.Xpp3Dom#toUnescapedString() #set ( $documentHeader = '' ) #if ( $item.name == "script" ) $StringUtils.replace( $item.toUnescapedString(), $documentHeader, "" ) #else $StringUtils.replace( $item.toString(), $documentHeader, "" ) #end #end #end $headContent
    $bodyContent

    ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/resources.txtdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000644000175000017500000000026510556666056033654 0ustar twernertwernerimages/expanded.gif images/collapsed.gif images/logos/maven-feather.png images/logos/build-by-maven-white.png images/logos/build-by-maven-black.png css/maven-base.css css/print.css ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/images/doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000755000175000017500000000000011633153574033640 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/images/expanded.gifdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000644000175000017500000000006410405203725033630 0ustar twernertwernerGIF89a! , j ;././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/images/collapsed.gifdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000644000175000017500000000006510405203725033631 0ustar twernertwernerGIF89a! , D`c5 ;././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/images/logos/doxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000755000175000017500000000000011633153574033640 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/images/logos/build-by-maven-black.pngdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000644000175000017500000000436610556666056033662 0ustar twernertwernerPNG  IHDRZ#/ pHYs.#.#x?vtIMEļIDATXXiLTY>* ( JBZ@%?h?"jbQd~(d\A $&21 "R`UJ-Z8m4ɴNǩs}~sɚTWWzxxQ(bYU&⥣f_غu+!6<<|8˲NNNΝKMM~~~1118`rrRT@IID"$www???t޶m[JJJ^^_^__q܅ eǏ ϟ_J5gϞ---(++;;;@TTTxxx@@={ݍKjOOOooﴴ4%0 # vh၁'Or3&`0LOO>իWҥKo czz:;;;>>|ܽ{Í  :;;~_ߘZ9q@#iiike@~~~___ppma̯svvvssC]B<==V<2 R&''Yp|y܀jݻwgv;!2<<'J^j2h2nll}ZVHG-3~;ueH/A:3{ CK7lk׮eC,ˢ?G[lXʹ%>5MSSӇnh4>}ZL&H$'ms<-_f˗Ye^z{{ZVMNNx"lCCCtJQQNvӧjo޼V???Á+q^.{{{7n܈)DX8*CthnnYGAKPP~6fq``˷Z~։zXx,rTʾ:X<33P(oeH$r122;vѣh["=..[#""CWWҋ,5&r1}@.f7BE`II :ujkkcF d0322@R2zu twwF1ߍ=p rwc3{ƶeKKK1͉D"@)(((((XBΝ;tvv RPT*2##̃{.3ckM|ĸccceY\{n<ϗ/_D"]Y,'OB-U*أ$4\R@oݺFVukFͿ'9`3cAaUuV!݋M@, 0;;[TTD<_VVQbtuuc,p344DW{{; <Ͽ{hFׯi>׌}'|vJzdt9&^=bpE@@*;;ɓ'@ٳg_~ȸz… 1y]>ucǎMO}}ŋդI._ sUU߿֭[@`&F˖-Ѽ}OgU:̪M͟"oo3.?Ú)Jz֝U ݽ?  XTwΝV8P^^2555sa`dxyyZtuu&>}:77䘘ٵk׳gϘ /ԁ&&& 7lxɞ[1K3+J2>eggaA3|~9gǚ37Va㖕e$)8QWW:9s$&&Q T#** 2p XX T`vww[...( ,b`\|1g]*˟ y|?';#?FAvVN=\JzK_`r|y9 y0*r Krp&@!!!'= ~a4)))`2??s;y>/~œO}]_EҜ;q֏, _~:ZGpYGLL"R&X "68~ X@=y`Vd@a?~@9w܃T_\\ ,**rttQUU&+XX@V%=ygO}{;vo/q?Blߘ$lY[{ET8u/NW*pGQ9X*))S{zzXX nnnSS &ܹRkߜ`1  SBl?~rr2<8]>5[V:rn_bz΢U1w?`M=%C.?2~3o=cS@J%+* l71~ ` L u}ߏot?#+'3'&.&L,18 .9}$,f.qfIvvF~t@ X#}݅ÃT~߽~ϯ9}9Y/A2L?M}a]X!DQp Q`'<% ?."T/|ݛ?~{˯nN%A/lls1?l\\<4t3@AM$]VM/` X.B`kXpk޼yR {:"!8Ab 6sssC+u31~QtH#0W ,Ae bh0Zʅ r6"„NSTOr?]PXm;8pKm6{0XbDغ FLKK &R`T4 XkC2`O08 t1#+}@.0^|  c",M7Bv "2<܁l`O!|`[˗/ `Kn.ЕGkY`2`ߙ1> eC`]N3,]UH:t*)$Kxǧ(@ĉᝫOB[l[80??{Ύǖ6$0Ctmذȝ9s& A Ağ AjRRDWcc#XHKx= b9`At+&&owK `3¾r ydx).`xoG€'Q @Cl?{,d0YjT i' ϹV@,D>'OB FV¿ _AVQΐ[) ~102@ԫ[&MD ةb `ρU;$tAvҒO۷oGͭϣ ""$0!xW2002x~"E^Q'+**Acٲeh-1HR0D@5L ρ5Ç ϯ_G `8FED tk.`3 #I… !UV eҥKAQXtApg!9L,l < _߃s-4!##4dD5d= oBB TWbqqq`:@dgF< J@Cх  @q 0*DF̬L> lNΧϮ3Z32rqt1;& H &-THsF0cyyypM^w" (hkkKL } 'ƒ]I@G':`={`Tpr3|~, | HKH`|\v H= ,V^V+*HA< `vY8 P@4P@Z':vrIENDB`././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/images/logos/build-by-maven-white.pngdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/res0000644000175000017500000000432410556666056033654 0ustar twernertwernerPNG  IHDRZ#/ pHYs.#.#x?vtIME5BasIDATXY}LS[{_b6(_i _ڠA+ D+*5وp dQyFC$XkX\*R>  VDOj G>|a?Ι3̙sJ!`&^`/&)--{hW^1 ;2j0~!pwtt>|СC"hݳu|~`` |8::ZRR%ɖ-[WXA,hܚJY֯^ R߰aåKFg\]]RD"!իW%&&VWWڵݻ[n%$$cǔJׅ~zr<66uuuslll.B!fx<EQnnn*؁Di***fS5>>>]mX***֭[ ))))FoD0L\\\\\ٳg ERRRaa.]G,TVVV=عsg{{}Ε+WH2jl6fQe9! }}}aaa3t.zqUUU``{ω/mccc|>Ņ(,Z(Lfo8>s,A֖޽{-˗hi:44 }S?L!55uƍ$F02á 3{l/n&'S˲ 1CBCC7Z aFquwwJD1e{6wO+l.@ !͛hJc6KU*J*..BVg\.%R$z||\VT覦'Nxzz:99)ʊyd23&&wRh4Vupp ;UvT6Noooݍc^^^& !t9wtt$9rOimmihdWeddd~ਫ#v˱ O:Eؾ}dpqĽ~޾^z }2VY|9U__9(({^RR~:v5** CVSS#UPP@z߭[>}:22DN8rss?m4ׇoB^Ȍ 1M+v-8nŃj*++C]x?n޼8j}'8p:s 6`4?\\}}=f/^Ln5BBB0SҞ!{BOQ fHtL&|]$ ϟ?OQTcc#YVIx28Ÿ!sDzlcc#WZEǏcӓ`D+Woad( ܃)_+lQ+fz}^^^OO*VݝGHPH.3s5/^RendererException class.

    * * @author Emmanuel Venisse * @version $Id: RendererException.java 746999 2009-02-23 12:56:04Z vsiveton $ */ public class RendererException extends Exception { private static final long serialVersionUID = 3141592653589793238L; /** * Construct a RendererException with a message. * * @param message a custom message. */ public RendererException( String message ) { super( message ); } /** * Construct a RendererException with a message and a cause. * * @param message a custom message. * @param t the cause. */ public RendererException( String message, Throwable t ) { super( message, t ); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultS0000644000175000017500000007606411372511224033472 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.LineNumberReader; import java.io.OutputStream; import java.io.Reader; import java.io.StringReader; import java.io.StringWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.Enumeration; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import org.apache.maven.doxia.Doxia; import org.apache.maven.doxia.logging.PlexusLoggerWrapper; import org.apache.maven.doxia.sink.render.RenderingContext; import org.apache.maven.doxia.parser.ParseException; import org.apache.maven.doxia.parser.Parser; import org.apache.maven.doxia.parser.manager.ParserNotFoundException; import org.apache.maven.doxia.site.decoration.DecorationModel; import org.apache.maven.doxia.module.site.SiteModule; import org.apache.maven.doxia.module.site.manager.SiteModuleManager; import org.apache.maven.doxia.module.site.manager.SiteModuleNotFoundException; import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink; import org.apache.maven.doxia.util.XmlValidator; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.context.Context; import org.codehaus.plexus.i18n.I18N; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.util.DirectoryScanner; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.PathTool; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.WriterFactory; import org.codehaus.plexus.velocity.SiteResourceLoader; import org.codehaus.plexus.velocity.VelocityComponent; /** *

    DefaultSiteRenderer class.

    * * @author Emmanuel Venisse * @author Vincent Siveton * @version $Id: DefaultSiteRenderer.java 943453 2010-05-12 11:35:48Z ltheussl $ * @since 1.0 * @plexus.component role-hint="default" */ public class DefaultSiteRenderer extends AbstractLogEnabled implements Renderer { // ---------------------------------------------------------------------- // Requirements // ---------------------------------------------------------------------- /** @plexus.requirement */ private VelocityComponent velocity; /** * @plexus.requirement */ private SiteModuleManager siteModuleManager; /** @plexus.requirement */ private Doxia doxia; /** @plexus.requirement */ private I18N i18n; private static final String RESOURCE_DIR = "org/apache/maven/doxia/siterenderer/resources"; private static final String DEFAULT_TEMPLATE = RESOURCE_DIR + "/default-site.vm"; private static final String SKIN_TEMPLATE_LOCATION = "META-INF/maven/site.vm"; // ---------------------------------------------------------------------- // Renderer implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void render( Collection documents, SiteRenderingContext siteRenderingContext, File outputDirectory ) throws RendererException, IOException { renderModule( documents, siteRenderingContext, outputDirectory ); for ( Iterator i = siteRenderingContext.getSiteDirectories().iterator(); i.hasNext(); ) { File siteDirectory = (File) i.next(); copyResources( siteRenderingContext, new File( siteDirectory, "resources" ), outputDirectory ); } } /** {@inheritDoc} */ public Map locateDocumentFiles( SiteRenderingContext siteRenderingContext ) throws IOException, RendererException { Map files = new LinkedHashMap(); Map moduleExcludes = siteRenderingContext.getModuleExcludes(); for ( Iterator i = siteRenderingContext.getSiteDirectories().iterator(); i.hasNext(); ) { File siteDirectory = (File) i.next(); if ( siteDirectory.exists() ) { for ( Iterator j = siteModuleManager.getSiteModules().iterator(); j.hasNext(); ) { SiteModule module = (SiteModule) j.next(); File moduleBasedir = new File( siteDirectory, module.getSourceDirectory() ); if ( moduleExcludes != null && moduleExcludes.containsKey( module.getParserId() ) ) { addModuleFiles( moduleBasedir, module, (String) moduleExcludes.get( module.getParserId() ), files ); } else { addModuleFiles( moduleBasedir, module, null, files ); } } } } for ( Iterator i = siteRenderingContext.getModules().iterator(); i.hasNext(); ) { ModuleReference module = (ModuleReference) i.next(); try { if ( moduleExcludes != null && moduleExcludes.containsKey( module.getParserId() ) ) { addModuleFiles( module.getBasedir(), siteModuleManager.getSiteModule( module.getParserId() ), (String) moduleExcludes.get( module.getParserId() ), files ); } else { addModuleFiles( module.getBasedir(), siteModuleManager.getSiteModule( module.getParserId() ), null, files ); } } catch ( SiteModuleNotFoundException e ) { throw new RendererException( "Unable to find module: " + e.getMessage(), e ); } } return files; } private void addModuleFiles( File moduleBasedir, SiteModule module, String excludes, Map files ) throws IOException, RendererException { if ( moduleBasedir.exists() ) { List allFiles = FileUtils.getFileNames( moduleBasedir, "**/*.*", excludes, false ); String lowerCaseExtension = module.getExtension().toLowerCase( Locale.ENGLISH ); List docs = new LinkedList( allFiles ); // Take care of extension case for ( Iterator it = docs.iterator(); it.hasNext(); ) { String name = it.next().toString().trim(); if ( !name.toLowerCase( Locale.ENGLISH ).endsWith( "." + lowerCaseExtension ) ) { it.remove(); } } List velocityFiles = new LinkedList( allFiles ); // *.xml.vm for ( Iterator it = velocityFiles.iterator(); it.hasNext(); ) { String name = it.next().toString().trim(); if ( !name.toLowerCase( Locale.ENGLISH ).endsWith( lowerCaseExtension + ".vm" ) ) { it.remove(); } } docs.addAll( velocityFiles ); for ( Iterator k = docs.iterator(); k.hasNext(); ) { String doc = k.next().toString().trim(); RenderingContext context = new RenderingContext( moduleBasedir, doc, module.getParserId(), module.getExtension() ); // TODO: DOXIA-111: we need a general filter here that knows how to alter the context if ( doc.toLowerCase( Locale.ENGLISH ).endsWith( ".vm" ) ) { context.setAttribute( "velocity", "true" ); } String key = context.getOutputName(); key = StringUtils.replace( key, "\\", "/" ); if ( files.containsKey( key ) ) { DocumentRenderer renderer = (DocumentRenderer) files.get( key ); RenderingContext originalContext = renderer.getRenderingContext(); File originalDoc = new File( originalContext.getBasedir(), originalContext.getInputName() ); throw new RendererException( "Files '" + module.getSourceDirectory() + File.separator + doc + "' clashes with existing '" + originalDoc + "'." ); } // ----------------------------------------------------------------------- // Handle key without case differences // ----------------------------------------------------------------------- for ( Iterator iter = files.entrySet().iterator(); iter.hasNext(); ) { Map.Entry entry = (Map.Entry) iter.next(); if ( entry.getKey().toString().equalsIgnoreCase( key ) ) { DocumentRenderer renderer = (DocumentRenderer) files.get( entry.getKey() ); RenderingContext originalContext = renderer.getRenderingContext(); File originalDoc = new File( originalContext.getBasedir(), originalContext.getInputName() ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { throw new RendererException( "Files '" + module.getSourceDirectory() + File.separator + doc + "' clashes with existing '" + originalDoc + "'." ); } if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Files '" + module.getSourceDirectory() + File.separator + doc + "' could clashes with existing '" + originalDoc + "'." ); } } } files.put( key, new DoxiaDocumentRenderer( context ) ); } } } private void renderModule( Collection docs, SiteRenderingContext siteRenderingContext, File outputDirectory ) throws IOException, RendererException { for ( Iterator i = docs.iterator(); i.hasNext(); ) { DocumentRenderer docRenderer = (DocumentRenderer) i.next(); RenderingContext renderingContext = docRenderer.getRenderingContext(); File outputFile = new File( outputDirectory, docRenderer.getOutputName() ); File inputFile = new File( renderingContext.getBasedir(), renderingContext.getInputName() ); boolean modified = !outputFile.exists() || ( inputFile.lastModified() > outputFile.lastModified() ) || ( siteRenderingContext.getDecoration().getLastModified() > outputFile.lastModified() ); if ( modified || docRenderer.isOverwrite() ) { if ( !outputFile.getParentFile().exists() ) { outputFile.getParentFile().mkdirs(); } if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Generating " + outputFile ); } Writer writer = null; try { writer = WriterFactory.newWriter( outputFile, siteRenderingContext.getOutputEncoding() ); docRenderer.renderDocument( writer, this, siteRenderingContext ); } finally { IOUtil.close( writer ); } } else { if ( getLogger().isDebugEnabled() ) { getLogger().debug( inputFile + " unchanged, not regenerating..." ); } } } } /** {@inheritDoc} */ public void renderDocument( Writer writer, RenderingContext renderingContext, SiteRenderingContext context ) throws RendererException, FileNotFoundException, UnsupportedEncodingException { SiteRendererSink sink = new SiteRendererSink( renderingContext ); File doc = new File( renderingContext.getBasedir(), renderingContext.getInputName() ); Reader reader = null; try { String resource = doc.getAbsolutePath(); Parser parser = doxia.getParser( renderingContext.getParserId() ); // TODO: DOXIA-111: the filter used here must be checked generally. if ( renderingContext.getAttribute( "velocity" ) != null ) { try { SiteResourceLoader.setResource( resource ); Context vc = createContext( sink, context ); StringWriter sw = new StringWriter(); velocity.getEngine().mergeTemplate( resource, context.getInputEncoding(), vc, sw ); reader = new StringReader( sw.toString() ); } catch ( Exception e ) { if ( getLogger().isDebugEnabled() ) { getLogger().error( "Error parsing " + resource + " as a velocity template, using as text.", e ); } else { getLogger().error( "Error parsing " + resource + " as a velocity template, using as text." ); } } } else { switch ( parser.getType() ) { case Parser.XML_TYPE: reader = ReaderFactory.newXmlReader( doc ); if ( context.isValidate() ) { reader = validate( reader, resource ); } break; case Parser.TXT_TYPE: case Parser.UNKNOWN_TYPE: default: reader = ReaderFactory.newReader( doc, context.getInputEncoding() ); } } sink.enableLogging( new PlexusLoggerWrapper( getLogger() ) ); doxia.parse( reader, renderingContext.getParserId(), sink ); } catch ( ParserNotFoundException e ) { throw new RendererException( "Error getting a parser for '" + doc + "': " + e.getMessage(), e ); } catch ( ParseException e ) { throw new RendererException( "Error parsing '" + doc + "': line [" + e.getLineNumber() + "] " + e.getMessage(), e ); } catch ( IOException e ) { throw new RendererException( "IOException when processing '" + doc + "'", e ); } finally { sink.flush(); sink.close(); IOUtil.close( reader ); } generateDocument( writer, sink, context ); } private Context createContext( SiteRendererSink sink, SiteRenderingContext siteRenderingContext ) { VelocityContext context = new VelocityContext(); // ---------------------------------------------------------------------- // Data objects // ---------------------------------------------------------------------- RenderingContext renderingContext = sink.getRenderingContext(); context.put( "relativePath", renderingContext.getRelativePath() ); // Add infos from document context.put( "authors", sink.getAuthors() ); String title = ""; if ( siteRenderingContext.getDecoration().getName() != null ) { title = siteRenderingContext.getDecoration().getName(); } else if ( siteRenderingContext.getDefaultWindowTitle() != null ) { title = siteRenderingContext.getDefaultWindowTitle(); } if ( title.length() > 0 ) { title += " - "; } title += sink.getTitle(); context.put( "title", title ); context.put( "headContent", sink.getHead() ); context.put( "bodyContent", sink.getBody() ); context.put( "decoration", siteRenderingContext.getDecoration() ); SimpleDateFormat sdf = new SimpleDateFormat( "yyyyMMdd" ); if ( StringUtils.isNotEmpty( sink.getDate() ) ) { try { // we support only ISO-8601 date context.put( "dateCreation", sdf.format( new SimpleDateFormat( "yyyy-MM-dd" ).parse( sink.getDate() ) ) ); } catch ( java.text.ParseException e ) { getLogger().debug( "Could not parse date: " + sink.getDate() + ", ignoring!", e ); } } context.put( "dateRevision", sdf.format( new Date() ) ); context.put( "currentDate", new Date() ); Locale locale = siteRenderingContext.getLocale(); context.put( "dateFormat", DateFormat.getDateInstance( DateFormat.DEFAULT, locale ) ); String currentFileName = renderingContext.getOutputName().replace( '\\', '/' ); context.put( "currentFileName", currentFileName ); context.put( "alignedFileName", PathTool.calculateLink( currentFileName, renderingContext.getRelativePath() ) ); context.put( "locale", locale ); // Add user properties Map templateProperties = siteRenderingContext.getTemplateProperties(); if ( templateProperties != null ) { for ( Iterator i = templateProperties.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); context.put( key, templateProperties.get( key ) ); } } // ---------------------------------------------------------------------- // Tools // ---------------------------------------------------------------------- context.put( "PathTool", new PathTool() ); context.put( "FileUtils", new FileUtils() ); context.put( "StringUtils", new StringUtils() ); context.put( "i18n", i18n ); return context; } /** {@inheritDoc} */ public void generateDocument( Writer writer, SiteRendererSink sink, SiteRenderingContext siteRenderingContext ) throws RendererException { Context context = createContext( sink, siteRenderingContext ); writeTemplate( writer, context, siteRenderingContext ); } private void writeTemplate( Writer writer, Context context, SiteRenderingContext siteContext ) throws RendererException { ClassLoader old = null; if ( siteContext.getTemplateClassLoader() != null ) { // ------------------------------------------------------------------------- // If no template classloader was set we'll just use the context classloader // ------------------------------------------------------------------------- old = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader( siteContext.getTemplateClassLoader() ); } try { processTemplate( siteContext.getTemplateName(), context, writer ); } finally { IOUtil.close( writer ); if ( old != null ) { Thread.currentThread().setContextClassLoader( old ); } } } /** * @noinspection OverlyBroadCatchBlock,UnusedCatchParameter */ private void processTemplate( String templateName, Context context, Writer writer ) throws RendererException { Template template; try { template = velocity.getEngine().getTemplate( templateName ); } catch ( Exception e ) { throw new RendererException( "Could not find the template '" + templateName, e ); } try { template.merge( context, writer ); } catch ( Exception e ) { throw new RendererException( "Error while generating code.", e ); } } /** {@inheritDoc} */ public SiteRenderingContext createContextForSkin( File skinFile, Map attributes, DecorationModel decoration, String defaultWindowTitle, Locale locale ) throws IOException { SiteRenderingContext context = new SiteRenderingContext(); // TODO: plexus-archiver, if it could do the excludes ZipFile zipFile = new ZipFile( skinFile ); try { if ( zipFile.getEntry( SKIN_TEMPLATE_LOCATION ) != null ) { context.setTemplateName( SKIN_TEMPLATE_LOCATION ); context.setTemplateClassLoader( new URLClassLoader( new URL[]{skinFile.toURI().toURL()} ) ); } else { context.setTemplateName( DEFAULT_TEMPLATE ); context.setTemplateClassLoader( getClass().getClassLoader() ); context.setUsingDefaultTemplate( true ); } } finally { closeZipFile( zipFile ); } context.setTemplateProperties( attributes ); context.setLocale( locale ); context.setDecoration( decoration ); context.setDefaultWindowTitle( defaultWindowTitle ); context.setSkinJarFile( skinFile ); return context; } /** {@inheritDoc} */ public SiteRenderingContext createContextForTemplate( File templateFile, File skinFile, Map attributes, DecorationModel decoration, String defaultWindowTitle, Locale locale ) throws MalformedURLException { SiteRenderingContext context = new SiteRenderingContext(); context.setTemplateName( templateFile.getName() ); context.setTemplateClassLoader( new URLClassLoader( new URL[]{templateFile.getParentFile().toURI().toURL()} ) ); context.setTemplateProperties( attributes ); context.setLocale( locale ); context.setDecoration( decoration ); context.setDefaultWindowTitle( defaultWindowTitle ); context.setSkinJarFile( skinFile ); return context; } private void closeZipFile( ZipFile zipFile ) { // TODO: move to plexus utils try { zipFile.close(); } catch ( IOException e ) { // ignore } } /** {@inheritDoc} */ public void copyResources( SiteRenderingContext siteRenderingContext, File resourcesDirectory, File outputDirectory ) throws IOException { if ( siteRenderingContext.getSkinJarFile() != null ) { // TODO: plexus-archiver, if it could do the excludes ZipFile file = new ZipFile( siteRenderingContext.getSkinJarFile() ); try { for ( Enumeration e = file.entries(); e.hasMoreElements(); ) { ZipEntry entry = (ZipEntry) e.nextElement(); if ( !entry.getName().startsWith( "META-INF/" ) ) { File destFile = new File( outputDirectory, entry.getName() ); if ( !entry.isDirectory() ) { destFile.getParentFile().mkdirs(); copyFileFromZip( file, entry, destFile ); } else { destFile.mkdirs(); } } } } finally { file.close(); } } if ( siteRenderingContext.isUsingDefaultTemplate() ) { InputStream resourceList = getClass().getClassLoader() .getResourceAsStream( RESOURCE_DIR + "/resources.txt" ); if ( resourceList != null ) { Reader r = null; try { r = ReaderFactory.newReader( resourceList, ReaderFactory.UTF_8 ); LineNumberReader reader = new LineNumberReader( r ); String line = reader.readLine(); while ( line != null ) { InputStream is = getClass().getClassLoader().getResourceAsStream( RESOURCE_DIR + "/" + line ); if ( is == null ) { throw new IOException( "The resource " + line + " doesn't exist." ); } File outputFile = new File( outputDirectory, line ); if ( !outputFile.getParentFile().exists() ) { outputFile.getParentFile().mkdirs(); } OutputStream os = null; try { // for the images os = new FileOutputStream( outputFile ); IOUtil.copy( is, os ); } finally { IOUtil.close( os ); } IOUtil.close( is ); line = reader.readLine(); } } finally { IOUtil.close( r ); } } } // Copy extra site resources if ( resourcesDirectory != null && resourcesDirectory.exists() ) { copyDirectory( resourcesDirectory, outputDirectory ); } // Check for the existence of /css/site.css File siteCssFile = new File( outputDirectory, "/css/site.css" ); if ( !siteCssFile.exists() ) { // Create the subdirectory css if it doesn't exist, DOXIA-151 File cssDirectory = new File( outputDirectory, "/css/" ); boolean created = cssDirectory.mkdirs(); if ( created && getLogger().isDebugEnabled() ) { getLogger().debug( "The directory '" + cssDirectory.getAbsolutePath() + "' did not exist. It was created." ); } // If the file is not there - create an empty file, DOXIA-86 if ( getLogger().isDebugEnabled() ) { getLogger().debug( "The file '" + siteCssFile.getAbsolutePath() + "' does not exists. Creating an empty file." ); } Writer writer = null; try { writer = WriterFactory.newWriter( siteCssFile, siteRenderingContext.getOutputEncoding() ); //DOXIA-290...the file should not be 0 bytes. writer.write( "/* You can override this file with your own styles */" ); } finally { IOUtil.close( writer ); } } } private void copyFileFromZip( ZipFile file, ZipEntry entry, File destFile ) throws IOException { FileOutputStream fos = new FileOutputStream( destFile ); try { IOUtil.copy( file.getInputStream( entry ), fos ); } finally { IOUtil.close( fos ); } } /** * Copy the directory * * @param source source file to be copied * @param destination destination file * @throws java.io.IOException if any */ protected void copyDirectory( File source, File destination ) throws IOException { if ( source.exists() ) { DirectoryScanner scanner = new DirectoryScanner(); String[] includedResources = {"**/**"}; scanner.setIncludes( includedResources ); scanner.addDefaultExcludes(); scanner.setBasedir( source ); scanner.scan(); List includedFiles = Arrays.asList( scanner.getIncludedFiles() ); for ( Iterator j = includedFiles.iterator(); j.hasNext(); ) { String name = (String) j.next(); File sourceFile = new File( source, name ); File destinationFile = new File( destination, name ); FileUtils.copyFile( sourceFile, destinationFile ); } } } private Reader validate( Reader source, String resource ) throws ParseException, IOException { getLogger().debug( "Validating: " + resource ); try { String content = IOUtil.toString( new BufferedReader( source ) ); new XmlValidator( new PlexusLoggerWrapper( getLogger() ) ).validate( content ); return new StringReader( content ); } finally { IOUtil.close( source ); } } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer0000644000175000017500000001155111150516344033521 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.io.Writer; import java.net.MalformedURLException; import java.util.Collection; import java.util.Locale; import java.util.Map; import org.apache.maven.doxia.sink.render.RenderingContext; import org.apache.maven.doxia.site.decoration.DecorationModel; import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink; /** *

    Renderer interface.

    * * @author Emmanuel Venisse * @version $Id: Renderer.java 746999 2009-02-23 12:56:04Z vsiveton $ */ public interface Renderer { /** * Plexus lookup role. */ String ROLE = Renderer.class.getName(); /** * Render a collection of documents. * * @param documents the documents to render. * @param siteRenderingContext the SiteRenderingContext to use. * @param outputDirectory the output directory to write results. * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs. * @throws java.io.IOException if it bombs. */ void render( Collection documents, SiteRenderingContext siteRenderingContext, File outputDirectory ) throws RendererException, IOException; /** * Generate a document. * * @param writer the Writer to use. * @param sink the Sink to receive the events. * @param siteRenderingContext the SiteRenderingContext to use. * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs. */ void generateDocument( Writer writer, SiteRendererSink sink, SiteRenderingContext siteRenderingContext ) throws RendererException; /** * Return a SiteRenderingContext. * * @param skinFile * @param attributes * @param decoration * @param defaultWindowTitle * @param locale * @return a SiteRenderingContext. * @throws java.io.IOException if it bombs. */ SiteRenderingContext createContextForSkin( File skinFile, Map attributes, DecorationModel decoration, String defaultWindowTitle, Locale locale ) throws IOException; /** * Return a SiteRenderingContext. * * @param templateFile * @param skinFile * @param attributes * @param decoration * @param defaultWindowTitle * @param locale * @return a SiteRenderingContext. * @throws java.net.MalformedURLException if it bombs. */ SiteRenderingContext createContextForTemplate( File templateFile, File skinFile, Map attributes, DecorationModel decoration, String defaultWindowTitle, Locale locale ) throws MalformedURLException; /** * Copy resource files. * * @param siteRenderingContext * @param resourcesDirectory * @param outputDirectory * @throws java.io.IOException if it bombs. */ void copyResources( SiteRenderingContext siteRenderingContext, File resourcesDirectory, File outputDirectory ) throws IOException; /** * Return the document files in a Map. * * @param siteRenderingContext * @return the document files in a Map. * @throws java.io.IOException if it bombs. * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs. */ Map locateDocumentFiles( SiteRenderingContext siteRenderingContext ) throws IOException, RendererException; /** * Render a document. * * @param writer * @param renderingContext * @param context * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs. * @throws java.io.FileNotFoundException if it bombs. * @throws java.io.UnsupportedEncodingException if it bombs. */ void renderDocument( Writer writer, RenderingContext renderingContext, SiteRenderingContext context ) throws RendererException, FileNotFoundException, UnsupportedEncodingException; } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDoc0000644000175000017500000000425011150516344033443 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.FileNotFoundException; import java.io.UnsupportedEncodingException; import java.io.Writer; import org.apache.maven.doxia.sink.render.RenderingContext; /** * Renders a page with Doxia. * * @author Brett Porter * @version $Id: DoxiaDocumentRenderer.java 746999 2009-02-23 12:56:04Z vsiveton $ */ public class DoxiaDocumentRenderer implements DocumentRenderer { private RenderingContext renderingContext; /** * Constructor. * * @param renderingContext the RenderingContext to use. */ public DoxiaDocumentRenderer( RenderingContext renderingContext ) { this.renderingContext = renderingContext; } /** {@inheritDoc} */ public void renderDocument( Writer writer, Renderer renderer, SiteRenderingContext siteRenderingContext ) throws RendererException, FileNotFoundException, UnsupportedEncodingException { renderer.renderDocument( writer, renderingContext, siteRenderingContext ); } /** {@inheritDoc} */ public String getOutputName() { return renderingContext.getOutputName(); } /** {@inheritDoc} */ public RenderingContext getRenderingContext() { return renderingContext; } /** {@inheritDoc} */ public boolean isOverwrite() { return false; } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/ModuleReference.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/ModuleRe0000644000175000017500000000320011150516344033457 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; /** * Holds a small extra module reference in the list of added modules to the rendering context. * * @author Brett Porter */ class ModuleReference { private final String parserId; private final File basedir; ModuleReference( String parserId, File basedir ) { this.parserId = parserId; this.basedir = basedir; } /** *

    Getter for the field parserId.

    * * @return a {@link java.lang.String} object. */ public String getParserId() { return parserId; } /** *

    Getter for the field basedir.

    * * @return a {@link java.io.File} object. */ public File getBasedir() { return basedir; } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRend0000644000175000017500000002121011372511224033457 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.Map; import org.apache.maven.doxia.site.decoration.DecorationModel; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.WriterFactory; /** *

    SiteRenderingContext class.

    * * @author Brett Porter * @version $Id: SiteRenderingContext.java 943453 2010-05-12 11:35:48Z ltheussl $ */ public class SiteRenderingContext { private String inputEncoding = ReaderFactory.UTF_8; private String outputEncoding = WriterFactory.UTF_8; private String templateName; private ClassLoader templateClassLoader; private Map templateProperties; private Locale locale = Locale.getDefault(); private DecorationModel decoration; private String defaultWindowTitle; private File skinJarFile; private boolean usingDefaultTemplate; private List siteDirectories = new ArrayList(); private Map moduleExcludes; private List modules = new ArrayList(); private boolean validate; /** * If input documents should be validated before parsing. * By default no validation is performed. * * @return true if validation is switched on. * @since 1.1.3 */ public boolean isValidate() { return validate; } /** * Switch on/off validation. * * @param validate true to switch on validation. * @since 1.1.3 */ public void setValidate( boolean validate ) { this.validate = validate; } /** *

    Getter for the field templateName.

    * * @return a {@link java.lang.String} object. */ public String getTemplateName() { return templateName; } /** *

    Getter for the field templateClassLoader.

    * * @return a {@link java.lang.ClassLoader} object. */ public ClassLoader getTemplateClassLoader() { return templateClassLoader; } /** *

    Setter for the field templateClassLoader.

    * * @param templateClassLoader a {@link java.lang.ClassLoader} object. */ public void setTemplateClassLoader( ClassLoader templateClassLoader ) { this.templateClassLoader = templateClassLoader; } /** *

    Getter for the field templateProperties.

    * * @return a {@link java.util.Map} object. */ public Map getTemplateProperties() { return templateProperties; } /** *

    Setter for the field templateProperties.

    * * @param templateProperties a {@link java.util.Map} object. */ public void setTemplateProperties( Map templateProperties ) { this.templateProperties = Collections.unmodifiableMap( templateProperties ); } /** *

    Getter for the field locale.

    * * @return a {@link java.util.Locale} object. */ public Locale getLocale() { return locale; } /** *

    Setter for the field locale.

    * * @param locale a {@link java.util.Locale} object. */ public void setLocale( Locale locale ) { this.locale = locale; } /** *

    Getter for the field decoration.

    * * @return a {@link org.apache.maven.doxia.site.decoration.DecorationModel} object. */ public DecorationModel getDecoration() { return decoration; } /** *

    Setter for the field decoration.

    * * @param decoration a {@link org.apache.maven.doxia.site.decoration.DecorationModel} object. */ public void setDecoration( DecorationModel decoration ) { this.decoration = decoration; } /** *

    Setter for the field defaultWindowTitle.

    * * @param defaultWindowTitle a {@link java.lang.String} object. */ public void setDefaultWindowTitle( String defaultWindowTitle ) { this.defaultWindowTitle = defaultWindowTitle; } /** *

    Getter for the field defaultWindowTitle.

    * * @return a {@link java.lang.String} object. */ public String getDefaultWindowTitle() { return defaultWindowTitle; } /** *

    Getter for the field skinJarFile.

    * * @return a {@link java.io.File} object. */ public File getSkinJarFile() { return skinJarFile; } /** *

    Setter for the field skinJarFile.

    * * @param skinJarFile a {@link java.io.File} object. */ public void setSkinJarFile( File skinJarFile ) { this.skinJarFile = skinJarFile; } /** *

    Setter for the field templateName.

    * * @param templateName a {@link java.lang.String} object. */ public void setTemplateName( String templateName ) { this.templateName = templateName; } /** *

    Setter for the field usingDefaultTemplate.

    * * @param usingDefaultTemplate a boolean. */ public void setUsingDefaultTemplate( boolean usingDefaultTemplate ) { this.usingDefaultTemplate = usingDefaultTemplate; } /** *

    isUsingDefaultTemplate.

    * * @return a boolean. */ public boolean isUsingDefaultTemplate() { return usingDefaultTemplate; } /** *

    addSiteDirectory.

    * * @param file a {@link java.io.File} object. */ public void addSiteDirectory( File file ) { this.siteDirectories.add( file ); } /** *

    addModuleDirectory.

    * * @param file a {@link java.io.File} object. * @param moduleParserId a {@link java.lang.String} object. */ public void addModuleDirectory( File file, String moduleParserId ) { this.modules.add( new ModuleReference( moduleParserId, file ) ); } /** *

    Getter for the field siteDirectories.

    * * @return a {@link java.util.List} object. */ public List getSiteDirectories() { return siteDirectories; } /** *

    Getter for the field modules.

    * * @return a {@link java.util.List} object. */ public List getModules() { return modules; } /** *

    Getter for the field moduleExcludes.

    * * @return a {@link java.util.Map} object. */ public Map getModuleExcludes() { return moduleExcludes; } /** *

    Setter for the field moduleExcludes.

    * * @param moduleExcludes a {@link java.util.Map} object. */ public void setModuleExcludes( Map moduleExcludes ) { this.moduleExcludes = moduleExcludes; } /** *

    Getter for the field inputEncoding.

    * * @return a {@link java.lang.String} object. */ public String getInputEncoding() { return inputEncoding; } /** *

    Setter for the field inputEncoding.

    * * @param inputEncoding a {@link java.lang.String} object. */ public void setInputEncoding( String inputEncoding ) { this.inputEncoding = inputEncoding; } /** *

    Getter for the field outputEncoding.

    * * @return a {@link java.lang.String} object. */ public String getOutputEncoding() { return outputEncoding; } /** *

    Setter for the field outputEncoding.

    * * @param outputEncoding a {@link java.lang.String} object. */ public void setOutputEncoding( String outputEncoding ) { this.outputEncoding = outputEncoding; } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Document0000644000175000017500000000431511167435272033541 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.FileNotFoundException; import java.io.UnsupportedEncodingException; import java.io.Writer; import org.apache.maven.doxia.sink.render.RenderingContext; /** * Renders a page. * * @author Brett Porter * @version $Id: DocumentRenderer.java 763758 2009-04-09 18:13:14Z ltheussl $ */ public interface DocumentRenderer { /** * Render a document. * * @param writer the Writer. * @param renderer the Renderer. * @param siteRenderingContext the SiteRenderingContext. * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs. * @throws java.io.FileNotFoundException if it bombs. * @throws java.io.UnsupportedEncodingException if it bombs. */ void renderDocument( Writer writer, Renderer renderer, SiteRenderingContext siteRenderingContext ) throws RendererException, FileNotFoundException, UnsupportedEncodingException; /** * The name of the output document. * * @return the name of the output document. */ String getOutputName(); /** * Return the RenderingContext. * * @return RenderingContext. */ RenderingContext getRenderingContext(); /** * Whether to always overwrite the document, or only do so when it is changed. * * @return whether to overwrite */ boolean isOverwrite(); } doxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/sink/0000755000175000017500000000000011633153573033000 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/sink/SiteRendererSink.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/sink/Sit0000644000175000017500000001554311367326505033473 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer.sink; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.StringWriter; import java.io.Writer; import java.util.ArrayList; import java.util.List; import javax.swing.text.html.HTML.Attribute; import org.apache.maven.doxia.module.xhtml.XhtmlSink; import org.apache.maven.doxia.sink.render.RenderingContext; import org.apache.maven.doxia.sink.Sink; import org.apache.maven.doxia.sink.SinkEventAttributes; import org.apache.maven.doxia.util.HtmlTools; import org.codehaus.plexus.util.StringUtils; /** * Sink for site rendering. * * @author Emmanuel Venisse * @version $Id: SiteRendererSink.java 940257 2010-05-02 16:50:13Z hboutemy $ */ public class SiteRendererSink extends XhtmlSink implements Sink, org.codehaus.doxia.sink.Sink { private String date = ""; private String title = ""; private List authors = new ArrayList(); private final StringWriter headWriter; private StringBuffer sectionTitleBuffer; private boolean sectionHasID; private final Writer writer; private RenderingContext renderingContext; /** * Construct a new SiteRendererSink. * * @param renderingContext the RenderingContext. */ public SiteRendererSink( RenderingContext renderingContext ) { this( new StringWriter(), renderingContext ); } /** * Construct a new SiteRendererSink. * * @param writer the writer for the sink. * @param renderingContext the RenderingContext. */ private SiteRendererSink( StringWriter writer, RenderingContext renderingContext ) { super( writer ); this.writer = writer; this.headWriter = new StringWriter(); this.renderingContext = renderingContext; } /** {@inheritDoc} */ public void title_() { if ( getTextBuffer().length() > 0 ) { title = getTextBuffer().toString(); } resetTextBuffer(); } /** * {@inheritDoc} * * Do nothing. * @see org.apache.maven.doxia.module.xhtml.XhtmlSink#title() */ public void title() { // nop } /** *

    Getter for the field title.

    * * @return a {@link java.lang.String} object. */ public String getTitle() { return title; } /** {@inheritDoc} */ public void author_() { if ( getTextBuffer().length() > 0 ) { String text = HtmlTools.escapeHTML( getTextBuffer().toString() ); text = StringUtils.replace( text, "&#", "&#" ); authors.add( text.trim() ); } resetTextBuffer(); } /** *

    Getter for the field authors.

    * * @return a {@link java.util.List} object. */ public List getAuthors() { return authors; } /** {@inheritDoc} */ public void date_() { if ( getTextBuffer().length() > 0 ) { date = getTextBuffer().toString().trim(); } resetTextBuffer(); } /** *

    Getter for the field date.

    * * @return a {@link java.lang.String} object. */ public String getDate() { return date; } /** * {@inheritDoc} * * Do nothing. * @see org.apache.maven.doxia.module.xhtml.XhtmlSink#body_() */ public void body_() { // nop } /** * {@inheritDoc} * * Do nothing. * @see org.apache.maven.doxia.module.xhtml.XhtmlSink#body() */ public void body() { // nop } /** *

    getBody.

    * * @return a {@link java.lang.String} object. */ public String getBody() { return writer.toString(); } /** *

    getHead.

    * * @return a {@link java.lang.String} object. * * @since 1.1.1 */ public String getHead() { return headWriter.toString(); } /** {@inheritDoc} */ public void head_() { setHeadFlag( false ); } /** {@inheritDoc} */ public void head() { setHeadFlag( true ); } /** {@inheritDoc} */ protected void onSectionTitle( int depth, SinkEventAttributes attributes ) { this.sectionTitleBuffer = new StringBuffer(); sectionHasID = ( attributes != null && attributes.isDefined ( Attribute.ID.toString() ) ); super.onSectionTitle( depth, attributes ); } /** {@inheritDoc} */ protected void onSectionTitle_( int depth ) { String sectionTitle = sectionTitleBuffer.toString(); this.sectionTitleBuffer = null; if ( !sectionHasID && !StringUtils.isEmpty( sectionTitle ) ) { anchor( HtmlTools.encodeId( sectionTitle ) ); anchor_(); } else { sectionHasID = false; } super.onSectionTitle_( depth ); } /** *

    Getter for the field renderingContext.

    * * @return the current rendering context * @since 1.1 */ public RenderingContext getRenderingContext() { return renderingContext; } /** {@inheritDoc} */ public void text( String text ) { if ( sectionTitleBuffer != null ) { // this implies we're inside a section title, collect text events for anchor generation sectionTitleBuffer.append( text ); } super.text( text ); } /** {@inheritDoc} */ protected void write( String text ) { if ( isHeadFlag() ) { headWriter.write( unifyEOLs( text ) ); return; } if ( renderingContext != null ) { String relativePathToBasedir = renderingContext.getRelativePath(); if ( relativePathToBasedir == null ) { text = StringUtils.replace( text, "$relativePath", "." ); } else { text = StringUtils.replace( text, "$relativePath", relativePathToBasedir ); } } super.write( text ); } } doxia-sitetools-1.1.4/doxia-site-renderer/src/site/0000755000175000017500000000000011633153574022217 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/site/site.xml0000644000175000017500000000167211103331430023670 0ustar twernertwerner doxia-sitetools-1.1.4/doxia-site-renderer/src/test/0000755000175000017500000000000011633153573022231 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/0000755000175000017500000000000011633153573024243 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site-validate/0000755000175000017500000000000011633153573026776 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site-validate/xdoc/0000755000175000017500000000000011633153573027733 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site-validate/xdoc/xdoc-2.0.xsd0000644000175000017500000026011711467567360031724 0ustar twernertwerner Xdoc 2.0 XML Schema. This is based on: Extensible HTML version 1.0 Transitional XML Schema http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd For further information, see: http://maven.apache.org/doxia/references/xdoc-format.html ================ Character mnemonic entities ========================= XHTML entity sets are identified by the PUBLIC and SYSTEM identifiers: PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent" PUBLIC "-//W3C//ENTITIES Special for XHTML//EN" SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent" PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN" SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent" ================== Imported Names ==================================== media type, as per [RFC2045] comma-separated list of media types, as per [RFC2045] a character encoding, as per [RFC2045] a space separated list of character encodings, as per [RFC2045] a language code, as per [RFC3066] a single character, as per section 2.2 of [XML] one or more digits tabindex attribute specifies the position of the current element in the tabbing order for the current document. This value must be a number between 0 and 32767. User agents should ignore leading zeros. space-separated list of link types single or comma-separated list of media descriptors a Uniform Resource Identifier, see [RFC2396] a space separated list of Uniform Resource Identifiers date and time information. ISO date format script expression style sheet data used for titles etc. render in this frame nn for pixels or nn% for percentage length pixel, percentage, or relative integer representing length in pixels these are used for image maps comma separated list of lengths used for object, applet, img, input and iframe a color using sRGB: #RRGGBB as Hex values There are also 16 widely known color names with their sRGB values: Black = #000000 Green = #008000 Silver = #C0C0C0 Lime = #00FF00 Gray = #808080 Olive = #808000 White = #FFFFFF Yellow = #FFFF00 Maroon = #800000 Navy = #000080 Red = #FF0000 Blue = #0000FF Purple = #800080 Teal = #008080 Fuchsia= #FF00FF Aqua = #00FFFF =================== Generic Attributes =============================== core attributes common to most elements id document-wide unique id class space separated list of classes style associated style info title advisory title/amplification internationalization attributes lang language code (backwards compatible) xml:lang language code (as per XML 1.0 spec) dir direction for weak/neutral text attributes for common UI events onclick a pointer button was clicked ondblclick a pointer button was double clicked onmousedown a pointer button was pressed down onmouseup a pointer button was released onmousemove a pointer was moved onto the element onmouseout a pointer was moved away from the element onkeypress a key was pressed and released onkeydown a key was pressed down onkeyup a key was released attributes for elements that can get the focus accesskey accessibility key character tabindex position in tabbing order onfocus the element got the focus onblur the element lost the focus text alignment for p, div, h1-h6. The default is align="left" for ltr headings, "right" for rtl =================== Text Elements ==================================== these can only occur at block level these can only occur at block level "Inline" covers inline or "text-level" element ================== Block level elements ============================== "Flow" mixes block and inline and is used for list items etc. ================== Content models for exclusions ===================== a elements use "Inline" excluding a pre uses "Inline" excluding img, object, applet, big, small, font, or basefont form uses "Flow" excluding form button uses "Flow" but excludes a, form, form controls, iframe ================ Document Head ======================================= content model is "head.misc" combined with a single title and an optional base element in any order The title element is not considered part of the flow of text. It should be displayed, for example as the page header or window title. Exactly one title is required per document. document base URI generic metainformation Relationship values can be used in principle: a) for document specific toolbars/menus when used with the link element in document head e.g. start, contents, previous, next, index, end, help b) to link to a separate style sheet (rel="stylesheet") c) to make a link to a script (rel="script") d) by stylesheets to control how collections of html nodes are rendered into printed documents e) to make a link to a printable version of this document e.g. a PostScript or PDF version (rel="alternate" media="print") style info, which may include CDATA sections script statements, which may include CDATA sections alternate content container for non script-based rendering ======================= Frames ======================================= inline subwindow alternate content container for non frame-based rendering =================== Document Body ==================================== generic language/style container =================== Paragraphs ======================================= =================== Headings ========================================= There are six levels of headings from h1 (the most important) to h6 (the least important). =================== Lists ============================================ Unordered list bullet styles Unordered list Ordered list numbering style 1 arabic numbers 1, 2, 3, ... a lower alpha a, b, c, ... A upper alpha A, B, C, ... i lower roman i, ii, iii, ... I upper roman I, II, III, ... The style is applied to the sequence number which by default is reset to 1 for the first list item in an ordered list. Ordered (numbered) list single column list (DEPRECATED) multiple column list (DEPRECATED) LIStyle is constrained to: "(ULStyle|OLStyle)" list item definition lists - dt for term, dd for its definition =================== Address ========================================== information on author =================== Horizontal Rule ================================== =================== Preformatted Text ================================ content is "Inline" excluding "img|object|applet|big|small|sub|sup|font|basefont" =================== Block-like Quotes ================================ =================== Text alignment =================================== center content =================== Inserted/Deleted Text ============================ ins/del are allowed in block and inline content, but its inappropriate to include block content within an ins element occurring in inline content. ================== The Anchor Element ================================ content is "Inline" except that anchors shouldn't be nested ===================== Inline Elements ================================ generic language/style container I18N BiDi over-ride forced line break emphasis strong emphasis definitional program code sample something user would type variable citation abbreviation acronym inlined quote subscript superscript fixed pitch font italic font bold font bigger font smaller font underline strike-through strike-through base font size local change to font ==================== Object ====================================== object is used to embed objects as part of HTML pages. param elements should precede other content. Parameters can also be expressed as attribute/value pairs on the object element itself when brevity is desired. param is used to supply a named property value. In XML it would seem natural to follow RDF and support an abbreviated syntax where the param elements are replaced by attribute value pairs on the object start tag. =================== Java applet ================================== One of code or object attributes must be present. Place param elements before other content. =================== Images =========================================== To avoid accessibility problems for people who aren't able to see the image, you should provide a text description using the alt and longdesc attributes. In addition, avoid the use of server-side image maps. usemap points to a map element which may be in this document or an external document, although the latter is not widely supported ================== Client-side image maps ============================ These can be placed in the same document or grouped in a separate document although this isn't yet widely supported ================ Forms =============================================== Each label must not contain more than ONE field Label elements shouldn't be nested. form control the name attribute is required for all but submit & reset option selector option group selectable choice multi-line text field The fieldset element is used to group form fields. Only one legend element should occur in the content and if present should only be preceded by whitespace. NOTE: this content model is different from the XHTML 1.0 DTD, closer to the intended content model in HTML4 DTD fieldset label Content is "Flow" excluding a, form and form controls single-line text input control (DEPRECATED) ======================= Tables ======================================= Derived from IETF HTML table standard, see [RFC1942] The border attribute sets the thickness of the frame around the table. The default units are screen pixels. The frame attribute specifies which parts of the frame around the table should be rendered. The values are not the same as CALS to avoid a name clash with the valign attribute. The rules attribute defines which rules to draw between cells: If rules is absent then assume: "none" if border is absent or border="0" otherwise "all" horizontal placement of table relative to document horizontal alignment attributes for cell contents char alignment char, e.g. char=':' charoff offset for alignment char vertical alignment attributes for cell contents Use thead to duplicate headers when breaking table across page boundaries, or for static headers when tbody sections are rendered in scrolling panel. Use tfoot to duplicate footers when breaking table across page boundaries, or for static footers when tbody sections are rendered in scrolling panel. Use multiple tbody sections when rules are needed between groups of table rows. colgroup groups a set of col elements. It allows you to group several semantically related columns together. col elements define the alignment properties for cells in one or more columns. The width attribute specifies the width of the columns, e.g. width=64 width in screen pixels width=0.5* relative width of 0.5 The span attribute causes the attributes of one col element to apply to more than one column. Scope is simpler than headers attribute for common tables th is for headers, td for data and for cells acting as both ================== Xdoc Specific ===================================== ================ Document Structure ================================== 2.0.0 The <document/> element is the root of the Xdoc descriptor. 2.0.0 Optional properties element for this document element. 2.0.0 Optional head element for this document element. 2.0.0 Required body element for this document element. 2.0.0 The identifier of this document element. ================ Document Properties ================================= 2.0.0 Required title element for the document element. 2.0.0 Optional author element for the document element. 2.0.0 Optional creation/last updated date for the document element. 2.0.0 An author element. 2.0.0 The email attribute for the author element. 2.0.0 An date element. The date is recommended (but it is not a requirement) to be align to the ISO-8601 standard, i.e.: YYYY-MM-DD. =================== Document Body ==================================== 2.0.0 The body element. 2.0.0 A section in the body element. 2.0.0 A section element. 2.0.0 A subsection in the section element. 2.0.0 A subsection element. ================ Document Addons ===================================== See "special.extra" group. 2.0.0 A source element. 2.0.0 A macro element. doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site-validate/xdoc/entityTest.xml0000644000175000017500000000553011467567360032644 0ustar twernertwerner %HTMLlat1; ]> Test entities, cdatas and comments Ligature Æ Ampersand & Less than < Greater than > Apostrophe ' Quote " test@email.com test©email.com

    Entities

    Generic Entities: '&' '<' '>' '"' '''

    '&' '<' '>' '"' '''

    Local Entities: 'Α' 'Β' 'Γ' '&tritPos;'

    'Α' 'Β' 'Γ' '&tritPos;𝟭' '&flo;ř' '&myCustomEntity;'

    DTD Entities: ' ' '¡' '¢'

    ' ' '¡' '¢'

    CDATA

    ]]>

    doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/0000755000175000017500000000000011633153573025207 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/resources/0000755000175000017500000000000011633153573027221 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/resources/confluence/0000755000175000017500000000000011633153573031342 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/resources/confluence/images/0000755000175000017500000000000011633153573032607 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/resources/confluence/images/build-by-maven-white.pngdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/resources/confluence/images/build-0000644000175000017500000000432411242734203033700 0ustar twernertwernerPNG  IHDRZ#/ pHYs.#.#x?vtIME5BasIDATXY}LS[{_b6(_i _ڠA+ D+*5وp dQyFC$XkX\*R>  VDOj G>|a?Ι3̙sJ!`&^`/&)--{hW^1 ;2j0~!pwtt>|СC"hݳu|~`` |8::ZRR%ɖ-[WXA,hܚJY֯^ R߰aåKFg\]]RD"!իW%&&VWWڵݻ[n%$$cǔJׅ~zr<66uuuslll.B!fx<EQnnn*؁Di***fS5>>>]mX***֭[ ))))FoD0L\\\\\ٳg ERRRaa.]G,TVVV=عsg{{}Ε+WH2jl6fQe9! }}}aaa3t.zqUUU``{ω/mccc|>Ņ(,Z(Lfo8>s,A֖޽{-˗hi:44 }S?L!55uƍ$F02á 3{l/n&'S˲ 1CBCC7Z aFquwwJD1e{6wO+l.@ !͛hJc6KU*J*..BVg\.%R$z||\VT覦'Nxzz:99)ʊyd23&&wRh4Vupp ;UvT6Noooݍc^^^& !t9wtt$9rOimmihdWeddd~ਫ#v˱ O:Eؾ}dpqĽ~޾^z }2VY|9U__9(({^RR~:v5** CVSS#UPP@z߭[>}:22DN8rss?m4ׇoB^Ȍ 1M+v-8nŃj*++C]x?n޼8j}'8p:s 6`4?\\}}=f/^Ln5BBB0SҞ!{BOQ fHtL&|]$ ϟ?OQTcc#YVIx28Ÿ!sDzlcc#WZEǏcӓ`D+Woad( ܃)_+lQ+fz}^^^OO*VݝGHPH.3s5/^
    Title
    Section title Some content
    doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/docbook/sdocbook_full.xml0000644000175000017500000004231611215467777032216 0ustar twernertwerner
    Title Or How I Learned to Live citetitle Configuring Menus CorpAuthor Date Assn. articleinfo Abstract Title articleinfo Abstract Content PhD Main Author Sr. D Director of Cooperative Efforts Cooperative Engineering Title super hero. Dr Peter Doe Sr. Spiderman Director of Cooperative Efforts Cooperative Engineering Title super hero. Authorgroup CorpAuthor Dr Authorgroup Author Sr. D Director of Cooperative Efforts Cooperative Engineering authorblurb title He's a super hero in his spare time. Dr Authorgroup Editor Sr. Spiderman Director of Cooperative Efforts Cooperative Engineering authorblurb title He's a super hero in his spare time. Dr Authorgroup OtherCredit Sr. AlterEgo Director of Cooperative Efforts Cooperative Engineering authorblurb title He's a super hero in his spare time. 1996 1997 me Edition Dr Peter Parker Sr. Spiderman Director of Cooperative Efforts Cooperative Engineering Title Peter's a super hero in his spare time. key1 key2 The Eiffel Tower Dr John Doe Sr. Spiderman Director of Cooperative Efforts Cooperative Engineering Title Peter's a super hero in his spare time. 1994 The TeX User's Group beta 15 3 No notice is required. 0.91 11 Dec 1996 ndw Bug fixes 0.90 30 Nov 1996 ndw long write up Electronic Publishing SGML (Computer program language) Abstract Title In brief.
    A trivial example of recursive sections. Section title
    Sub-section title
    Sub-sub-section title
    Sub-sub-sub-section title
    Sub-sub-sub-sub-section title William Shakespeare Epigraph: What say you? The Assn. of Computing Machinery has published Developing SGML DTDs. In UNIX command ls with the option is used to get a directory listing. The output from the date command is eg Sun Nov 16, 1997 21:03:29. An email address is eg yo@tu.com. The symbolic constants for error numbers are defined in errno.h in /usr/include/sys. This software is provided as is. Execute the command with command filename. This is hosted at helio.com. The name pipipo is traded. The name pipipo is registered. The name pipipo is copyrighted. The name pipipo is serviced. The name pipipo is traded. At the system prompt, enter xyzzy. A Sidebar Sidebar content. A link to an element with an XRefLabel: . A straight link generates the cross-reference text: . Phaser sound effect A sound effect. Italic font. Bold font. Monospaced font. A Real Function real function()Error!
    William Shakespeare Blockquote: What say you?
    An annual percentage rate of 3.27%The prime rate. will be charged on all balances. List item 1. List item 2.Paragraph contained in list item 2. Sub-list item 1. Sub-list item 2. List item 3. Force end of list: Verbatim text not contained in list item 3 Numbered item 1. Numbered item A. Numbered item B. Numbered item 2. List numbering schemes: [[1]], [[a]], [[A]], [[i]], [[I]]. Defined term 1of definition list. Defined term 2of definition list.Verbatim text in a box
    Figure title Figure caption
    Here is an inline image: . No grid, no caption: cell cell cell cell header header cell cell Horizontal Span a3a4a5 f1f2f3f4f5 b1b2b3b4 Vertical Span c1 Span Both c4 d1d4d5 a1a2a5 b1b2b3b4b5 c1c2c5 a1b1c1 a2 b2a1b2b1b2c1 b2a2b2b2b2c2 b2a3b2b3b2c3 c2 a3b3c3 Anchor. Link to Anchor. Link to http://www.pixware.fr. Link to showing alternate text. Link to Pixware home page. Upcoming Changes Future versions of this feature may not be backward-compatible.
    A Test Bibliography Books The World Wide Web Journal 21. O'Reilly & Associates, Inc. and Winter, 1996. Demonstration Appendix This appendix demonstrates an appendix.
    doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/xdoc/0000755000175000017500000000000011633153573026144 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/xdoc/macro.xml0000644000175000017500000000511311136256756027774 0ustar twernertwerner Test DOXIA-96 Vincent Siveton

    bla bla...

    bla bla...

    SUB SUB TITLE 1.2.1

    bla bla...

    bla bla...

    bla bla...

    SUB SUB TITLE 2.2.1

    bla bla...

    bla bla...

    bla bla...

    SUB SUB TITLE 3.2.1

    bla bla...

    doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/xdoc/javascript.xml0000644000175000017500000000255411207503365031035 0ustar twernertwerner Hello

    You should see a JavaScript alert...

    doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/xdoc/multipleblock.xml0000644000175000017500000000273411136256756031547 0ustar twernertwerner Test DOXIA-93 Vincent Siveton

    text

    • list1

    text2

    • list1

    text3

    • list1

    doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/xdoc/misc.xml0000644000175000017500000000222011136256756027622 0ustar twernertwerner doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/xdoc/attributes.xml0000644000175000017500000000545511136256756031072 0ustar twernertwerner

    Project

    Name Telephone
    Telephone 555 77 854 555 77 855
    555 77 854 555 77 855

    underline strike-through subscript superscript

    bold-italic italic-bold

    Link to anchor. Link to anchor showing alternate text. Link to Maven home page. Link to other document. Link to other document. Link to other document. Link to other document. Link to root document.

    doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/xdoc/head.xml0000644000175000017500000000223711170617234027566 0ustar twernertwerner Page Title John Doe

    Oi!

    doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/xdoc/nestedItems.xml0000644000175000017500000001304511136256756031162 0ustar twernertwerner Test List Issue

    Unordered lists

    Below is an unordered list, followed by six paragraphs.

    • Item 1.
      • Item 11.

      • Item 12.

      • Item 13.
      • Item 14.
    • Item 2.
    • Item 3.
    • Item 4.
      • Item 41.
      • Item 42.
      • Item 43.
      • Item 44.

    Paragraph 1 below list.

    Paragraph 2 below list.

    Paragraph 3 below list.

    Paragraph 4 below list.

    Paragraph 5 below list.

    Paragraph 6 below list.

    Ordered lists

    Below is an ordered list, followed by six paragraphs.

    1. Item 1.
      1. Item 11.
      2. Item 12.
      3. Item 13.
      4. Item 14.
    2. Item 2.
    3. Item 3.
    4. Item 4.
      1. Item 41.
      2. Item 42.
      3. Item 43.
      4. Item 44.

    Paragraph 1 below list.

    Paragraph 2 below list.

    Paragraph 3 below list.

    Paragraph 4 below list.

    Paragraph 5 below list.

    Paragraph 6 below list.

    Definition lists

    Below is a definition list, followed by six paragraphs.

    Term 1.
    Description 1.
    Term 2.
    Description 2.
    Term 21.
    Description 21.

    Paragraph 1 below list.

    Paragraph 2 below list.

    Paragraph 3 below list.

    Paragraph 4 below list.

    Paragraph 5 below list.

    Paragraph 6 below list.

    doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/site.xml0000644000175000017500000000365011136256756026706 0ustar twernertwerner Plexus http://plexus.codehaus.org/images/plexus-logo.png http://plexus.codehaus.org http://media.codehaus.org/images/unity-codehaus-logo.png http://www.codehaus.org doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/apt/0000755000175000017500000000000011633153573025773 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/apt/cdc.apt0000644000175000017500000001141011207763373027231 0ustar twernertwerner ----- Plexus Component Descriptor Creator ----- Trygve Laugstøl ----- 25th May 2005 ----- ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Plexus Component Descriptor Creator <> The Component Descriptor Creator (or CDC for short) is a tool that will create the <<>> file from your Java code. It uses a set of JavaDoc tags to gather the information it needs to create the component descriptor. * Component Tags *-------------------------------*--------------*---------------------------------------------* | <> | <> | <> | *-------------------------------*---*--------------------------------------------------------* | @plexus.component | y | Marker tag to mark a class as a Plexus component. | *-------------------------------*---*--------------------------------------------------------* | @plexus.role | y | The role of the component. | *-------------------------------*---*--------------------------------------------------------* | @plexus.version | n | The component version. | *-------------------------------*---*--------------------------------------------------------* | @plexus.lifecycle-handler | n | The lifecycle handler of the component. | *-------------------------------*---*--------------------------------------------------------* | @plexus.instatiation-strategy | n | The instantiation strategy of the component. | *-------------------------------*---*--------------------------------------------------------* +---+ /** * @plexus.component * @plexus.lifecycle-handler plexus-configurable */ public class DefaultActionManager extends AbstractLogEnabled implements ActionManager, Serviceable { +---+ ~~ [example-class-tags] Example Class Tags * Requirement Tags These tags are used on fields to state requirements. *-------------------------------*----------------*-------------------------------------------* | <> | <> | <> | *-------------------------------*-----*------------------------------------------------------* | @plexus.requirement | y | Marker tag to mark this field as requirement | *-------------------------------*-----*------------------------------------------------------* | @plexus.role | y/n | Only required if the field is a List or Map | *-------------------------------*-----*------------------------------------------------------* | @plexus.role-hint | n | | *-------------------------------*-----*------------------------------------------------------* +---+ /** * @plexus.requirement */ private ActionManager actionManager; +---+ ~~ [example-requirement-tags] Example Requirement Tags * Configuration Tags Note that the default value tag won't be required in the future when these tags will be used to generate a separate configuration declaration section. *-------------------------------*--------------*---------------------------------------------* | <> | <> | <> | *-------------------------------*---*--------------------------------------------------------* | @plexus.configuration | y | Marker tag to mark this field as configureable | *-------------------------------*---*--------------------------------------------------------* | @plexus.default-value | y | Sets the default value for the configuration field | *-------------------------------*---*--------------------------------------------------------* +---+ /** * @plexus.requirement * @plexus.role-hint velocity */ private Renderer renderer; +---+ ~~ [example-requirement-tags] Example Requirement Tags doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/apt/apt.apt0000644000175000017500000000320011210233341027237 0ustar twernertwerner ----- Anchors / Links in APT ----- Lukas Theussl ----- May 2008 ----- ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Links {Anchor} {cdc.html} Link to {{Anchor}}. Link to anchor {{{Anchor}showing alternate text}}. {Anchor with space} and {{{Anchor_with_space}link to it}}. Link to {{http://maven.apache.org/}}. Link to {{{http://maven.apache.org/}Maven home page}}. Link to {{{./cdc.html}other document}} and within {{{cdc.html}same document}}. Link to {{{/index.html}root document}}. Section formatting: <> <<>> * SubSection formatting: <> <<>> <> <<>> TOC Macro %{toc} Echo Macro %{echo|param1=value1|param2=value2} Snippet Macro %{snippet|id=macrotest|file=src/test/resources/site/site.xml} doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/apt/interpolation.apt0000644000175000017500000000213111136257022031355 0ustar twernertwerner ----- Project goodies that are available in the project ----- Maven Monkey ----- ----- ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Things you can do with Velocity * project = ${project.name} ${project.version} * $currentFileName doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/0000755000175000017500000000000011633153573027330 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/0000755000175000017500000000000011633153573031451 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/paragraph-header.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/paragraph-he0000644000175000017500000000007311242734203033722 0ustar twernertwerner A paragraph h2. A header with a header Another paragraph ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/nested-format.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/nested-forma0000644000175000017500000000022211242734203033743 0ustar twernertwerner A paragraph with *_bold italic_* _*italic bold*_ *{{bold monospaced}}* A paragraph with *bold _italic_* _italic *bold*_ *bold {{monospaced}}* ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/figure.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/figure.confl0000644000175000017500000000073611242734203033752 0ustar twernertwernerSimple paragraph. !images/build-by-maven-white.png! Simple paragraph with attempted inline !image.jpg! (should fail). DOXIA-361: !images/build-by-maven-white.png! With caption on same line !images/build-by-maven-white.png!\\ With caption underneath and linebreak !images/build-by-maven-white.png! With caption underneath and no linebreak !images/build-by-maven-white.png! With *bold* caption underneath DOXIA-303: !images/build-by-maven-white.png|align=right, vspace=4!././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/section.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/section.conf0000644000175000017500000000013711242734203033754 0ustar twernertwernerh1. Section1 h2. Section2 h3. Section3 h4. Section4 h5. Section5 h1. TitleWithLeadingSpace ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/simple-paragraph.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/simple-parag0000644000175000017500000000027711242734203033752 0ustar twernertwernerSimple paragraph with *bold* and _italic_ text. Here is a link to [JIRA|http://jira.codehaus.org] Here is a link with no text [http://jira.codehaus.org] This is some {{monospaced}} text. ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/paragraph-figure.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/paragraph-fi0000644000175000017500000000010011242734203033713 0ustar twernertwerner A paragraph !images/logo.png! with a figure Another paragraph ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/link.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/link.conflue0000644000175000017500000000016311242734203033752 0ustar twernertwernerLine with [middle] link Line with link at the [end] Line with [link#anchor] and [#simple] anchor and [alias|link]././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/nested-list.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/nested-list.0000644000175000017500000000016111242734203033672 0ustar twernertwerner A paragraph * A top level list item ** A nested list item ** Another nested list item * Back at the top level ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/nested-list-heterogenous.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/nested-list-0000644000175000017500000000015111242734203033670 0ustar twernertwerner* A top level list item *# A nested list item *# Another nested list item * Back at the top level ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/table-link.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/table-link.c0000644000175000017500000000047311242734203033632 0ustar twernertwerner|| Version || Download || Format || |0.1.1 |[Download|http://example.com/release.0.1.1/ex-win32-win32.x86.zip]| 12-12-2008 | zip | |0.1.2 |[http://example.com/release.0.1.2/ex-win32-win32.x86.zip]| 04-12-2008 | zip | |0.1.3 |[Download|http://example.com/release.0.1.3/ex-win32-win32.x86.zip]| 03-11-2008 | zip |././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/simple-list.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/simple-list.0000644000175000017500000000046711242734203033712 0ustar twernertwerner* Simple paragraph with *bold* and _italic_ text. * Here is a link to [JIRA|http://jira.codehaus.org] * Here is a link with no text [http://jira.codehaus.org] * This is some {{monospaced}} text. * Item with no formatting Paragraph * One bullet * A list item with more than one line *bold text, not a list!*././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/linebreak.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/linebreak.co0000644000175000017500000000005511242734203033717 0ustar twernertwernerLine\\ break. Line\\with 2\\inline\\ Breaks.././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/paragraph-list.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/paragraph-li0000644000175000017500000000014411242734203033731 0ustar twernertwerner A paragraph * A nested list item * Another nested list item with two lines Back at the top level ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/anchor.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/anchor.confl0000644000175000017500000000016411242734203033736 0ustar twernertwernerh1. Section Title {anchor:start}Simple paragraph. Simple paragraph{anchor:end} Simple {anchor:middle} paragraph. ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/escapes.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/escapes.conf0000644000175000017500000000026211242734203033732 0ustar twernertwernerSimple paragraph with asterisk \* and underline \_. Simple paragraph with asterisk \*not bold\* and underline \_not italic\_. Simple paragraph with normal \character escaped. ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/code.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/code.conflue0000644000175000017500000000064111242734203033730 0ustar twernertwernerSimple paragraph. {code:title=Cat.java} public class Cat { public void sitOn(Mat mat) { // ... code here } } {code} Another paragraph (the title of the code block is ignored). Simple paragraph with embedded code {code} public class Cat { public void sitOn(Mat mat) { // ... code here } } {code} in the same paragraph (this didn't work until DOXIA-181). See also DOXIA-302.././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/note-tip-info.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/note-tip-inf0000644000175000017500000000062711242734203033701 0ustar twernertwernerSimple paragraph. {note:title=Be Careful} The body of the note here.. {note} Tip {tip:title=Guess What?} The body of the tip here.. {tip} Info {info:title=Some Info} The body of the info here.. {info} Quote {quote:title=Simon Says} The body of the *quote* here.. {quote} (In all cases there is no way to reverse the Doxia output back to confluence because they are all rendered as a defitionList.)././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/table.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/table.conflu0000644000175000017500000000072111242734203033737 0ustar twernertwerner Simple table: ||heading 1||heading 2||heading 3|| |col A1|col A2|col A3| |col B1|col B2|col B3| Table with links (DOXIA-301): || Version || Download || Date || Format || |0.1.1 | [Download|http://example.com/release.0.1.1/ex-win32-win32.x86.zip] | 12-12-2008 | zip | |0.1.2 | [Download|http://example.com/release.0.1.2/ex-win32-win32.x86.zip] | 04-12-2008 | zip | |0.1.3 | [Download|http://example.com/release.0.1.3/ex-win32-win32.x86.zip] | 03-11-2008 | zip |././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/test.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/test.conflue0000644000175000017500000000325411242734203034000 0ustar twernertwernerThis the way that we would like to *translate* sites that are primarily authored in confluence while at the same time having the site be rendered in a _standard way on a static website_. ---- Here is a link to [JIRA|http://jira.codehaus.org] Here is a link with no text [http://jira.codehaus.org] This is some {{monospaced}} text. * item one ** foo ** bar * item two * item three Some more text # number one # number two # number three ||one||two||three|| |foo|bar|baz| h1. I am h1 this is how you would code a mojo! {code} public class MyMojo extends AbstractMojo { /** * @parameter expression="${plugin.artifacts}" * @required */ private List pluginArtifacts; public void execute() throws MojoExecutionException { ... for ( Iterator i = pluginArtifacts.iterator(); i.hasNext(); ) { Artifact pluginArtifact = (Artifact) i.next(); } ... } } {code} h2. I am h2 this is the way of the world {noformat} public class MyMojo extends AbstractMojo { /** * @parameter expression="${plugin.artifacts}" * @required */ private List pluginArtifacts; public void execute() throws MojoExecutionException { ... for ( Iterator i = pluginArtifacts.iterator(); i.hasNext(); ) { Artifact pluginArtifact = (Artifact) i.next(); } ... } } {noformat} h3. I am h3 this is the way of the world h4. I am h4 this is the way of the world h5. I am h5 this is the way of the world h1. Answered Questions h3. What can I do to get the Maven love? Well, you just have to be calm and the maven love will come your way. ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/unknown-macro.confluencedoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/confluence/confluence/unknown-macr0000644000175000017500000000014511242734203034002 0ustar twernertwerner{unknown:start}Simple paragraph. Simple paragraph{unknown:end}. Simple {unknown:middle} paragraph. doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/fml/0000755000175000017500000000000011633153573025765 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site/fml/faq.fml0000644000175000017500000000372611215432700027230 0ustar twernertwerner Contributing One stupid question & a silly answer?

    A paragraph with a local link, a link to another source document, an external link with entities, and an italic text.

    Using Maven How do I disable a report on my site?

    Test nested <source></source> tags (DOXIA-16):

    1.5]]>
    doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/site-plugin.properties0000644000175000017500000000152110553160323030607 0ustar twernertwerner# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. template.lastpublished=Last Published template.builtby=Built by doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/xhtml-lat1.ent0000644000175000017500000002677711467567360027001 0ustar twernertwerner doxia-sitetools-1.1.4/doxia-site-renderer/src/test/resources/log4j.properties0000644000175000017500000000205010553160323027364 0ustar twernertwerner# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. log4j.rootCategory=INFO, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%c{1}:%L] %d{ISO8601} - %m%n log4j.logger.com.gargoylesoftware.htmlunit=ERROR doxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/0000755000175000017500000000000011633153572023151 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/0000755000175000017500000000000011633153572023740 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/0000755000175000017500000000000011633153572025161 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/0000755000175000017500000000000011633153572026267 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/0000755000175000017500000000000011633153572027373 5ustar twernertwernerdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/0000755000175000017500000000000011633153573032067 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/JavascriptVerifier.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/Javascri0000644000175000017500000000735211207503365033556 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import com.gargoylesoftware.htmlunit.CollectingAlertHandler; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlHeader2; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlParagraph; import com.gargoylesoftware.htmlunit.html.HtmlScript; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; /** * Verify javascript code. * * @author ltheussl * @version $Id: JavascriptVerifier.java 779585 2009-05-28 12:43:33Z ltheussl $ */ public class JavascriptVerifier extends AbstractVerifier { /** * Verifies a HtmlPage. * * @param file the file to verify. * * @throws Exception if something goes wrong. */ public void verify( String file ) throws Exception { File jsTest = getTestFile( "target/output/javascript.html" ); assertNotNull( jsTest ); assertTrue( jsTest.exists() ); // HtmlUnit WebClient webClient = new WebClient(); final List collectedAlerts = new ArrayList(); webClient.setAlertHandler( new CollectingAlertHandler( collectedAlerts ) ); HtmlPage page = (HtmlPage) webClient.getPage( jsTest.toURI().toURL() ); assertNotNull( page ); HtmlElement element = page.getHtmlElementById( "contentBox" ); assertNotNull( element ); HtmlDivision division = (HtmlDivision) element; assertNotNull( division ); Iterator elementIterator = division.getAllHtmlChildElements(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- HtmlDivision div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "section" ); HtmlHeader2 h2 = (HtmlHeader2) elementIterator.next(); assertNotNull( h2 ); assertEquals( h2.asText().trim(), "Test" ); HtmlAnchor a = (HtmlAnchor) elementIterator.next(); assertNotNull( a ); assertEquals( a.getAttributeValue( "name" ), "Test" ); HtmlParagraph p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "You should see a JavaScript alert..." ); HtmlScript script = (HtmlScript) elementIterator.next(); assertNotNull( script ); assertEquals( script.getAttributeValue( "type" ), "text/javascript" ); assertEquals( script.asText().trim(), "" ); final List expectedAlerts = Collections.singletonList( "Hello!" ); assertEquals( expectedAlerts, collectedAlerts ); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/MultipleBlockVerifier.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/Multiple0000644000175000017500000001170211130752271033576 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlHeader2; import com.gargoylesoftware.htmlunit.html.HtmlListItem; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlParagraph; import com.gargoylesoftware.htmlunit.html.HtmlUnorderedList; import java.util.Iterator; /** * * * @author ltheussl * @version $Id: MultipleBlockVerifier.java 732140 2009-01-06 22:01:29Z ltheussl $ */ public class MultipleBlockVerifier extends AbstractVerifier { /** {@inheritDoc} */ public void verify( String file ) throws Exception { HtmlPage page = htmlPage( file ); assertNotNull( page ); HtmlElement element = page.getHtmlElementById( "contentBox" ); assertNotNull( element ); HtmlDivision division = (HtmlDivision) element; assertNotNull( division ); Iterator elementIterator = division.getAllHtmlChildElements(); // ---------------------------------------------------------------------- // Verify link // ---------------------------------------------------------------------- HtmlDivision div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "section" ); HtmlHeader2 h2 = (HtmlHeader2) elementIterator.next(); assertNotNull( h2 ); assertEquals( h2.asText().trim(), "section name" ); HtmlAnchor a = (HtmlAnchor) elementIterator.next(); assertNotNull( a ); assertEquals( a.getAttributeValue( "name" ), "section_name" ); // ---------------------------------------------------------------------- // Paragraph // ---------------------------------------------------------------------- HtmlParagraph p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "text" ); // ---------------------------------------------------------------------- // Unordered list // ---------------------------------------------------------------------- HtmlUnorderedList ul = (HtmlUnorderedList) elementIterator.next(); assertNotNull( ul ); HtmlListItem li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "list1" ); // ---------------------------------------------------------------------- // Paragraph // ---------------------------------------------------------------------- p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "text2" ); // ---------------------------------------------------------------------- // Unordered list // ---------------------------------------------------------------------- ul = (HtmlUnorderedList) elementIterator.next(); assertNotNull( ul ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "list1" ); // ---------------------------------------------------------------------- // Paragraph // ---------------------------------------------------------------------- p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "text3" ); // ---------------------------------------------------------------------- // Unordered list // ---------------------------------------------------------------------- ul = (HtmlUnorderedList) elementIterator.next(); assertNotNull( ul ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.getFirstDomChild().asText().trim(), "list1" ); assertFalse( elementIterator.hasNext() ); } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/MiscVerifier.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/MiscVeri0000644000175000017500000000456411130752271033534 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import com.gargoylesoftware.htmlunit.html.HtmlApplet; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlParameter; import java.util.Iterator; /** * * * @author ltheussl * @version $Id: MiscVerifier.java 732140 2009-01-06 22:01:29Z ltheussl $ */ public class MiscVerifier extends AbstractVerifier { /** {@inheritDoc} */ public void verify( String file ) throws Exception { HtmlPage page = htmlPage( file ); assertNotNull( page ); HtmlElement element = page.getHtmlElementById( "contentBox" ); assertNotNull( element ); HtmlDivision division = (HtmlDivision) element; assertNotNull( division ); Iterator elementIterator = division.getAllHtmlChildElements(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- HtmlApplet applet = (HtmlApplet) elementIterator.next(); assertEquals( "org.micro.applet.Main", applet.getAttributeValue( "code" ) ); assertEquals( "micro-applet.jar", applet.getAttributeValue( "archive" ) ); HtmlParameter param = (HtmlParameter) elementIterator.next(); assertEquals( "midlet", param.getAttributeValue( "name" ) ); assertEquals( "org.micro.applet.SimpleDemoMIDlet", param.getAttributeValue( "value" ) ); } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/FaqVerifier.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/FaqVerif0000644000175000017500000001770511204502221033505 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlDefinitionDescription; import com.gargoylesoftware.htmlunit.html.HtmlDefinitionList; import com.gargoylesoftware.htmlunit.html.HtmlDefinitionTerm; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlHeader2; import com.gargoylesoftware.htmlunit.html.HtmlListItem; import com.gargoylesoftware.htmlunit.html.HtmlOrderedList; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlParagraph; import com.gargoylesoftware.htmlunit.html.HtmlPreformattedText; import java.util.Iterator; /** * * * @author ltheussl * @version $Id: FaqVerifier.java 776258 2009-05-19 10:06:09Z ltheussl $ */ public class FaqVerifier extends AbstractVerifier { /** {@inheritDoc} */ public void verify( String file ) throws Exception { HtmlPage page = htmlPage( file ); assertNotNull( page ); HtmlElement element = page.getHtmlElementById( "contentBox" ); assertNotNull( element ); HtmlDivision division = (HtmlDivision) element; assertNotNull( division ); Iterator elementIterator = division.getAllHtmlChildElements(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- HtmlDivision div = (HtmlDivision) elementIterator.next(); assertEquals( div.getAttributeValue( "class" ), "section" ); HtmlHeader2 h2 = (HtmlHeader2) elementIterator.next(); assertEquals( h2.asText().trim(), "Oft Asked Questions" ); HtmlAnchor a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "name" ), "top" ); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "name" ), "Oft_Asked_Questions" ); HtmlParagraph p = (HtmlParagraph) elementIterator.next(); element = (HtmlElement) elementIterator.next(); assertEquals( element.getTagName(), "b" ); assertEquals( element.asText().trim(), "Contributing" ); HtmlOrderedList ol = (HtmlOrderedList) elementIterator.next(); assertEquals( ol.getFirstDomChild().asText().trim(), "One stupid question & a silly answer?" ); HtmlListItem li = (HtmlListItem) elementIterator.next(); assertEquals( li.getFirstDomChild().asText().trim(), "One stupid question & a silly answer?" ); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "href" ), "#stupid-question" ); element = (HtmlElement) elementIterator.next(); assertEquals( element.getTagName(), "b" ); assertEquals( element.asText().trim(), "stupid" ); p = (HtmlParagraph) elementIterator.next(); element = (HtmlElement) elementIterator.next(); assertEquals( element.getTagName(), "b" ); assertEquals( element.asText().trim(), "Using Maven" ); ol = (HtmlOrderedList) elementIterator.next(); assertEquals( ol.getFirstDomChild().asText().trim(), "How do I disable a report on my site?" ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "How do I disable a report on my site?" ); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "href" ), "#disable-reports" ); div = (HtmlDivision) elementIterator.next(); assertEquals( div.getAttributeValue( "class" ), "section" ); h2 = (HtmlHeader2) elementIterator.next(); assertEquals( h2.asText().trim(), "Contributing" ); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "name" ), "Contributing" ); HtmlDefinitionList dl = (HtmlDefinitionList) elementIterator.next(); HtmlDefinitionTerm dt = (HtmlDefinitionTerm) elementIterator.next(); assertEquals( dt.getFirstDomChild().asText().trim(), "One stupid question & a silly answer?" ); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "name" ), "stupid-question" ); element = (HtmlElement) elementIterator.next(); assertEquals( element.getTagName(), "b" ); assertEquals( element.asText().trim(), "stupid" ); HtmlDefinitionDescription dd = (HtmlDefinitionDescription) elementIterator.next(); p = (HtmlParagraph) elementIterator.next(); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "href" ), "#Using_Maven" ); assertEquals( a.asText().trim(), "local link" ); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "href" ), "./cdc.html" ); assertEquals( a.asText().trim(), "source document" ); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "href" ), "http://maven.apache.org/?l=a&m=b" ); assertEquals( a.asText().trim(), "external link" ); element = (HtmlElement) elementIterator.next(); assertEquals( element.getTagName(), "i" ); assertEquals( element.asText().trim(), "italic" ); p = (HtmlParagraph) elementIterator.next(); assertEquals( p.getAttributeValue( "align" ), "right" ); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "href" ), "#top" ); assertEquals( a.asText().trim(), "[top]" ); div = (HtmlDivision) elementIterator.next(); assertEquals( div.getAttributeValue( "class" ), "section" ); h2 = (HtmlHeader2) elementIterator.next(); assertEquals( h2.asText().trim(), "Using Maven" ); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "name" ), "Using_Maven" ); dl = (HtmlDefinitionList) elementIterator.next(); dt = (HtmlDefinitionTerm) elementIterator.next(); assertEquals( dt.getFirstDomChild().asText().trim(), "How do I disable a report on my site?" ); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "name" ), "disable-reports" ); dd = (HtmlDefinitionDescription) elementIterator.next(); p = (HtmlParagraph) elementIterator.next(); element = (HtmlElement) elementIterator.next(); assertEquals( element.getTagName(), "tt" ); assertEquals( element.asText().trim(), "" ); div = (HtmlDivision) elementIterator.next(); assertEquals( div.getAttributeValue( "class" ), "source" ); HtmlPreformattedText pre = (HtmlPreformattedText) elementIterator.next(); assertEquals( pre.asText().trim(), "1.5" ); p = (HtmlParagraph) elementIterator.next(); assertEquals( p.getAttributeValue( "align" ), "right" ); a = (HtmlAnchor) elementIterator.next(); assertEquals( a.getAttributeValue( "href" ), "#top" ); assertEquals( a.asText().trim(), "[top]" ); assertFalse( elementIterator.hasNext() ); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/NestedItemsVerifier.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/NestedIt0000644000175000017500000003333511204502221033516 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlDefinitionDescription; import com.gargoylesoftware.htmlunit.html.HtmlDefinitionList; import com.gargoylesoftware.htmlunit.html.HtmlDefinitionTerm; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlHeader2; import com.gargoylesoftware.htmlunit.html.HtmlHeader4; import com.gargoylesoftware.htmlunit.html.HtmlListItem; import com.gargoylesoftware.htmlunit.html.HtmlOrderedList; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlParagraph; import com.gargoylesoftware.htmlunit.html.HtmlUnorderedList; import java.util.Iterator; /** * * * @author ltheussl * @version $Id: NestedItemsVerifier.java 776258 2009-05-19 10:06:09Z ltheussl $ */ public class NestedItemsVerifier extends AbstractVerifier { /** {@inheritDoc} */ public void verify( String file ) throws Exception { HtmlPage page = htmlPage( file ); assertNotNull( page ); HtmlElement element = page.getHtmlElementById( "contentBox" ); assertNotNull( element ); HtmlDivision division = (HtmlDivision) element; assertNotNull( division ); Iterator elementIterator = division.getAllHtmlChildElements(); // ---------------------------------------------------------------------- // Verify link // ---------------------------------------------------------------------- HtmlDivision div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "section" ); HtmlHeader2 h2 = (HtmlHeader2) elementIterator.next(); assertNotNull( h2 ); assertEquals( h2.asText().trim(), "List Section" ); HtmlAnchor a = (HtmlAnchor) elementIterator.next(); assertNotNull( a ); assertEquals( a.getAttributeValue( "name" ), "List_Section" ); // ---------------------------------------------------------------------- // Unordered lists // ---------------------------------------------------------------------- div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "section" ); div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "section" ); HtmlHeader4 h4 = (HtmlHeader4) elementIterator.next(); assertNotNull( h4 ); assertEquals( h4.asText().trim(), "Unordered lists" ); a = (HtmlAnchor) elementIterator.next(); assertNotNull( a ); assertEquals( a.getAttributeValue( "name" ), "Unordered_lists" ); HtmlParagraph p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Below is an unordered list, followed by six paragraphs." ); HtmlUnorderedList ul = (HtmlUnorderedList) elementIterator.next(); assertNotNull( ul ); HtmlListItem li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 1." ); ul = (HtmlUnorderedList) elementIterator.next(); assertNotNull( ul ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.getFirstDomChild().asText().trim(), "Item 11." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.getFirstDomChild().asText().trim(), "Item 12." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 13." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 14." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 2." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 3." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 4." ); ul = (HtmlUnorderedList) elementIterator.next(); assertNotNull( ul ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 41." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 42." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 43." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 44." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 1 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 2 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 3 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 4 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 5 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 6 below list." ); // ---------------------------------------------------------------------- // Ordered lists // ---------------------------------------------------------------------- div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "section" ); h4 = (HtmlHeader4) elementIterator.next(); assertNotNull( h4 ); assertEquals( h4.asText().trim(), "Ordered lists" ); a = (HtmlAnchor) elementIterator.next(); assertNotNull( a ); assertEquals( a.getAttributeValue( "name" ), "Ordered_lists" ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Below is an ordered list, followed by six paragraphs." ); HtmlOrderedList ol = (HtmlOrderedList) elementIterator.next(); assertNotNull( ol ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 1." ); ol = (HtmlOrderedList) elementIterator.next(); assertNotNull( ol ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 11." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 12." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 13." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 14." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 2." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 3." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 4." ); ol = (HtmlOrderedList) elementIterator.next(); assertNotNull( ol ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 41." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 42." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 43." ); li = (HtmlListItem) elementIterator.next(); assertNotNull( li ); assertEquals( li.getFirstDomChild().asText().trim(), "Item 44." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 1 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 2 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 3 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 4 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 5 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 6 below list." ); // ---------------------------------------------------------------------- // Definition lists // ---------------------------------------------------------------------- div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "section" ); h4 = (HtmlHeader4) elementIterator.next(); assertNotNull( h4 ); assertEquals( h4.asText().trim(), "Definition lists" ); a = (HtmlAnchor) elementIterator.next(); assertNotNull( a ); assertEquals( a.getAttributeValue( "name" ), "Definition_lists" ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Below is a definition list, followed by six paragraphs." ); HtmlDefinitionList dl = (HtmlDefinitionList) elementIterator.next(); assertNotNull( dl ); HtmlDefinitionTerm dt = (HtmlDefinitionTerm) elementIterator.next(); assertNotNull( dt ); assertEquals( dt.getFirstDomChild().asText().trim(), "Term 1." ); HtmlDefinitionDescription dd = (HtmlDefinitionDescription) elementIterator.next(); assertNotNull( dd ); assertEquals( dd.getFirstDomChild().asText().trim(), "Description 1." ); dt = (HtmlDefinitionTerm) elementIterator.next(); assertNotNull( dt ); assertEquals( dt.getFirstDomChild().asText().trim(), "Term 2." ); dd = (HtmlDefinitionDescription) elementIterator.next(); assertNotNull( dd ); assertEquals( dd.getFirstDomChild().asText().trim(), "Description 2." ); dl = (HtmlDefinitionList) elementIterator.next(); assertNotNull( dl ); dt = (HtmlDefinitionTerm) elementIterator.next(); assertNotNull( dt ); assertEquals( dt.getFirstDomChild().asText().trim(), "Term 21." ); dd = (HtmlDefinitionDescription) elementIterator.next(); assertNotNull( dd ); assertEquals( dd.getFirstDomChild().asText().trim(), "Description 21." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 1 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 2 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 3 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 4 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 5 below list." ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "Paragraph 6 below list." ); assertFalse( elementIterator.hasNext() ); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/AttributesVerifier.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/Attribut0000644000175000017500000002163311351662535033615 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlHeader2; import com.gargoylesoftware.htmlunit.html.HtmlHeader3; import com.gargoylesoftware.htmlunit.html.HtmlImage; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlParagraph; import com.gargoylesoftware.htmlunit.html.HtmlTable; import com.gargoylesoftware.htmlunit.html.HtmlTableDataCell; import com.gargoylesoftware.htmlunit.html.HtmlTableHeaderCell; import com.gargoylesoftware.htmlunit.html.HtmlTableRow; import com.gargoylesoftware.htmlunit.html.UnknownHtmlElement; import java.util.Iterator; /** * * * @author ltheussl * @version $Id: AttributesVerifier.java 926050 2010-03-22 12:41:01Z ltheussl $ */ public class AttributesVerifier extends AbstractVerifier { /** {@inheritDoc} */ public void verify( String file ) throws Exception { HtmlPage page = htmlPage( file ); assertNotNull( page ); HtmlElement element = page.getHtmlElementById( "contentBox" ); assertNotNull( element ); HtmlDivision division = (HtmlDivision) element; assertNotNull( division ); Iterator elementIterator = division.getAllHtmlChildElements(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- HtmlDivision div = (HtmlDivision) elementIterator.next(); assertEquals( "section", div.getAttributeValue( "class" ) ); HtmlHeader2 h2 = (HtmlHeader2) elementIterator.next(); assertNotNull( h2 ); assertEquals( "section", h2.asText().trim() ); HtmlAnchor a = (HtmlAnchor) elementIterator.next(); assertNotNull( a ); assertEquals( "section", a.getAttributeValue( "name" ) ); HtmlParagraph p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( "ID", p.getAttributeValue( "id" ) ); assertEquals( "CLASS", p.getAttributeValue( "class" ) ); assertEquals( "TITLE", p.getAttributeValue( "title" ) ); assertEquals( "STYLE", p.getAttributeValue( "style" ) ); assertEquals( "LANG", p.getAttributeValue( "lang" ) ); HtmlImage img = (HtmlImage) elementIterator.next(); assertNotNull( img ); assertEquals( "project.png", img.getAttributeValue( "src" ) ); assertEquals( "150", img.getAttributeValue( "width" ) ); assertEquals( "93", img.getAttributeValue( "height" ) ); assertEquals( "border: 1px solid silver", img.getAttributeValue( "style" ) ); assertEquals( "Project", img.getAttributeValue( "alt" ) ); // test object identity to distinguish the case ATTRIBUTE_VALUE_EMPTY assertTrue( img.getAttributeValue( "dummy" ) == HtmlElement.ATTRIBUTE_NOT_DEFINED ); HtmlTable table = (HtmlTable) elementIterator.next(); assertEquals( "1", table.getAttributeValue( "border" ) ); assertEquals( "none", table.getAttributeValue( "class" ) ); element = (HtmlElement) elementIterator.next(); // this is a htmlunit bug assertEquals( "tbody", element.getTagName() ); HtmlTableRow tr = (HtmlTableRow) elementIterator.next(); HtmlTableHeaderCell th = (HtmlTableHeaderCell) elementIterator.next(); th = (HtmlTableHeaderCell) elementIterator.next(); assertEquals( "center", th.getAttributeValue( "align" ) ); assertEquals( "2", th.getAttributeValue( "colspan" ) ); assertEquals( "50%", th.getAttributeValue( "width" ) ); tr = (HtmlTableRow) elementIterator.next(); th = (HtmlTableHeaderCell) elementIterator.next(); assertEquals( "2", th.getAttributeValue( "rowspan" ) ); assertEquals( "middle", th.getAttributeValue( "valign" ) ); HtmlTableDataCell td = (HtmlTableDataCell) elementIterator.next(); td = (HtmlTableDataCell) elementIterator.next(); tr = (HtmlTableRow) elementIterator.next(); td = (HtmlTableDataCell) elementIterator.next(); td = (HtmlTableDataCell) elementIterator.next(); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); UnknownHtmlElement unk = (UnknownHtmlElement) elementIterator.next(); assertEquals( "u", unk.getTagName() ); unk = (UnknownHtmlElement) elementIterator.next(); assertEquals( "s", unk.getTagName() ); unk = (UnknownHtmlElement) elementIterator.next(); assertEquals( "sub", unk.getTagName() ); unk = (UnknownHtmlElement) elementIterator.next(); assertEquals( "sup", unk.getTagName() ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); unk = (UnknownHtmlElement) elementIterator.next(); assertEquals( "b", unk.getTagName() ); unk = (UnknownHtmlElement) elementIterator.next(); assertEquals( "i", unk.getTagName() ); unk = (UnknownHtmlElement) elementIterator.next(); assertEquals( "i", unk.getTagName() ); unk = (UnknownHtmlElement) elementIterator.next(); assertEquals( "b", unk.getTagName() ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( "color: red; margin-left: 20px", p.getAttributeValue( "style" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "Anchor", a.getAttributeValue( "name" ) ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "#Anchor", a.getAttributeValue( "href" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "#Anchor", a.getAttributeValue( "href" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "http://maven.apache.org/", a.getAttributeValue( "href" ) ); assertEquals( "externalLink", a.getAttributeValue( "class" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "./cdc.html", a.getAttributeValue( "href" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "cdc.html", a.getAttributeValue( "href" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "cdc.pdf", a.getAttributeValue( "href" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "./cdc.txt", a.getAttributeValue( "href" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "/index.html", a.getAttributeValue( "href" ) ); div = (HtmlDivision) elementIterator.next(); assertEquals( "section", div.getAttributeValue( "class" ) ); h2 = (HtmlHeader2) elementIterator.next(); assertEquals( "Section without id", h2.asText().trim() ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "Section_without_id", a.getAttributeValue( "name" ) ); div = (HtmlDivision) elementIterator.next(); assertEquals( "section", div.getAttributeValue( "class" ) ); HtmlHeader3 h3 = (HtmlHeader3) elementIterator.next(); assertEquals( "Subsection without id", h3.asText().trim() ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "Subsection_without_id", a.getAttributeValue( "name" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "section-id", a.getAttributeValue( "name" ) ); div = (HtmlDivision) elementIterator.next(); assertEquals( "section", div.getAttributeValue( "class" ) ); h2 = (HtmlHeader2) elementIterator.next(); assertEquals( "Section with id", h2.asText().trim() ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "subsection-id", a.getAttributeValue( "name" ) ); div = (HtmlDivision) elementIterator.next(); assertEquals( "section", div.getAttributeValue( "class" ) ); h3 = (HtmlHeader3) elementIterator.next(); assertEquals( "Subsection with id", h3.asText().trim() ); assertFalse( elementIterator.hasNext() ); } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/AptVerifier.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/AptVerif0000644000175000017500000001534011210233341033514 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlHeader2; import com.gargoylesoftware.htmlunit.html.HtmlHeader3; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlParagraph; import com.gargoylesoftware.htmlunit.html.UnknownHtmlElement; import java.util.Iterator; /** * Verifies apt transformations. * * @author ltheussl * @version $Id: AptVerifier.java 780263 2009-05-30 13:38:41Z vsiveton $ */ public class AptVerifier extends AbstractVerifier { /** {@inheritDoc} */ public void verify( String file ) throws Exception { HtmlPage page = htmlPage( file ); assertNotNull( page ); HtmlElement element = page.getHtmlElementById( "contentBox" ); assertNotNull( element ); HtmlDivision division = (HtmlDivision) element; assertNotNull( division ); Iterator elementIterator = division.getAllHtmlChildElements(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- HtmlDivision div = (HtmlDivision) elementIterator.next(); assertEquals( "section", div.getAttributeValue( "class" ) ); HtmlHeader2 h2 = (HtmlHeader2) elementIterator.next(); assertNotNull( h2 ); assertEquals( "Links", h2.asText().trim() ); HtmlAnchor a = (HtmlAnchor) elementIterator.next(); assertEquals( "Links", a.getAttributeValue( "name" ) ); HtmlParagraph p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); // Expected log: [APT Parser] Ambiguous link: 'cdc.html'. If this is a local link, prepend "./"! a = (HtmlAnchor) elementIterator.next(); assertEquals( "Anchor", a.getAttributeValue( "name" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "cdc.html", a.getAttributeValue( "name" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "#Anchor", a.getAttributeValue( "href" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "#Anchor", a.getAttributeValue( "href" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "Anchor_with_space", a.getAttributeValue( "name" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "#Anchor_with_space", a.getAttributeValue( "href" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "http://maven.apache.org/", a.getAttributeValue( "href" ) ); assertEquals( "externalLink", a.getAttributeValue( "class" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "http://maven.apache.org/", a.getAttributeValue( "href" ) ); assertEquals( "externalLink", a.getAttributeValue( "class" ) ); // Expected log: [APT Parser] Ambiguous link: 'cdc.html'. If this is a local link, prepend "./"! a = (HtmlAnchor) elementIterator.next(); assertEquals( "./cdc.html", a.getAttributeValue( "href" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "#cdc.html", a.getAttributeValue( "href" ) ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "/index.html", a.getAttributeValue( "href" ) ); div = (HtmlDivision) elementIterator.next(); assertEquals( "section", div.getAttributeValue( "class" ) ); h2 = (HtmlHeader2) elementIterator.next(); assertNotNull( h2 ); assertEquals( "Section formatting: italic bold mono", h2.asText().trim() ); UnknownHtmlElement unknown = (UnknownHtmlElement) elementIterator.next(); assertEquals( "i", unknown.getTagName() ); assertEquals( "italic", unknown.asText().trim() ); unknown = (UnknownHtmlElement) elementIterator.next(); assertEquals( "b", unknown.getTagName() ); assertEquals( "bold", unknown.asText().trim() ); unknown = (UnknownHtmlElement) elementIterator.next(); assertEquals( "tt", unknown.getTagName() ); assertEquals( "mono", unknown.asText().trim() ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "Section_formatting:_italic_bold_mono", a.getAttributeValue( "name" ) ); div = (HtmlDivision) elementIterator.next(); assertEquals( "section", div.getAttributeValue( "class" ) ); HtmlHeader3 h3 = (HtmlHeader3) elementIterator.next(); assertNotNull( h3 ); assertEquals( "SubSection formatting: italic bold mono", h3.asText().trim() ); unknown = (UnknownHtmlElement) elementIterator.next(); assertEquals( "i", unknown.getTagName() ); assertEquals( "italic", unknown.asText().trim() ); unknown = (UnknownHtmlElement) elementIterator.next(); assertEquals( "b", unknown.getTagName() ); assertEquals( "bold", unknown.asText().trim() ); unknown = (UnknownHtmlElement) elementIterator.next(); assertEquals( "tt", unknown.getTagName() ); assertEquals( "mono", unknown.asText().trim() ); a = (HtmlAnchor) elementIterator.next(); assertEquals( "SubSection_formatting:_italic_bold_mono", a.getAttributeValue( "name" ) ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); unknown = (UnknownHtmlElement) elementIterator.next(); assertEquals( "i", unknown.getTagName() ); assertEquals( "italic", unknown.asText().trim() ); unknown = (UnknownHtmlElement) elementIterator.next(); assertEquals( "b", unknown.getTagName() ); assertEquals( "bold", unknown.asText().trim() ); unknown = (UnknownHtmlElement) elementIterator.next(); assertEquals( "tt", unknown.getTagName() ); assertEquals( "mono", unknown.asText().trim() ); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultS0000644000175000017500000002570211372511224033516 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Reader; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import org.apache.maven.doxia.site.decoration.DecorationModel; import org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Reader; import org.apache.maven.doxia.xsd.AbstractXmlValidatorTest; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.StringUtils; /** * @author Vincent Siveton * @author " ), -1 ); } finally { IOUtil.close( reader ); } } /** * @throws Exception if something goes wrong. */ public void verifyEntitiesPage() throws Exception { EntitiesVerifier verifier = new EntitiesVerifier(); verifier.verify( "target/output/entityTest.html" ); } /** * @throws Exception if something goes wrong. */ public void verifyJavascriptPage() throws Exception { JavascriptVerifier verifier = new JavascriptVerifier(); verifier.verify( "target/output/javascript.html" ); } /** * @throws Exception if something goes wrong. */ public void verifyFaqPage() throws Exception { FaqVerifier verifier = new FaqVerifier(); verifier.verify( "target/output/faq.html" ); } /** * @throws Exception if something goes wrong. */ public void verifyAttributes() throws Exception { AttributesVerifier verifier = new AttributesVerifier(); verifier.verify( "target/output/attributes.html" ); } /** * @throws Exception if something goes wrong. */ public void verifyMisc() throws Exception { MiscVerifier verifier = new MiscVerifier(); verifier.verify( "target/output/misc.html" ); } /** * @throws Exception if something goes wrong. */ public void verifyDocbookPageExists() throws Exception { File nestedItems = getTestFile( "target/output/docbook.html" ); assertNotNull( nestedItems ); assertTrue( nestedItems.exists() ); } /** * @throws Exception if something goes wrong. */ public void verifyApt() throws Exception { AptVerifier verifier = new AptVerifier(); verifier.verify( "target/output/apt.html" ); } /** * Validate the generated pages. * * @throws Exception if something goes wrong. * @since 1.1.1 */ public void validatePages() throws Exception { // Need to refactor... XhtmlValidatorTest validator = new XhtmlValidatorTest(); validator.setUp(); validator.testValidateFiles(); } protected static class XhtmlValidatorTest extends AbstractXmlValidatorTest { /** {@inheritDoc} */ protected void setUp() throws Exception { super.setUp(); } /** {@inheritDoc} */ protected void tearDown() throws Exception { super.tearDown(); } /** {@inheritDoc} */ protected String[] getIncludes() { return new String[] { "**/*.html" }; } /** {@inheritDoc} */ protected String addNamespaces( String content ) { return content; } /** {@inheritDoc} */ protected Map getTestDocuments() throws IOException { Map testDocs = new HashMap(); File dir = new File( getBasedir(), "target/output" ); List l = FileUtils.getFileNames( dir, getIncludes()[0], FileUtils.getDefaultExcludesAsString(), true ); for ( Iterator it = l.iterator(); it.hasNext(); ) { String file = it.next().toString(); file = StringUtils.replace( file, "\\", "/" ); Reader reader = ReaderFactory.newXmlReader( new File( file ) ); try { testDocs.put( file, IOUtil.toString( reader ) ); } finally { IOUtil.close( reader ); } } return testDocs; } /** {@inheritDoc} */ protected boolean isFailErrorMessage( String message ) { return true; } } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/EntitiesVerifier.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/Entities0000644000175000017500000001716111206736605033603 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlHeader2; import com.gargoylesoftware.htmlunit.html.HtmlHeader3; import com.gargoylesoftware.htmlunit.html.HtmlHeader4; import com.gargoylesoftware.htmlunit.html.HtmlMeta; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlParagraph; import com.gargoylesoftware.htmlunit.html.HtmlPreformattedText; import java.util.Iterator; /** * Verify the site/xdoc/entityTest.xml * * @author ltheussl * @version $Id: EntitiesVerifier.java 778641 2009-05-26 09:59:33Z vsiveton $ */ public class EntitiesVerifier extends AbstractVerifier { /** {@inheritDoc} */ public void verify( String file ) throws Exception { HtmlPage page = htmlPage( file ); assertNotNull( page ); HtmlMeta author = (HtmlMeta) page.getHtmlElementsByName( "author" ).get( 0 ); assertNotNull( author ); assertTrue( author.toString().indexOf( "Ligature Æ" ) > 0 ); assertEquals( "Ligature \u00C6", author.getContentAttribute() ); author = (HtmlMeta) page.getHtmlElementsByName( "author" ).get( 1 ); assertNotNull( author ); assertTrue( author.toString().indexOf( "Ampersand &" ) > 0 ); assertEquals( "Ampersand &", author.getContentAttribute() ); author = (HtmlMeta) page.getHtmlElementsByName( "author" ).get( 2 ); assertNotNull( author ); assertTrue( author.toString().indexOf( "Less than <" ) > 0 ); assertEquals( "Less than <", author.getContentAttribute() ); author = (HtmlMeta) page.getHtmlElementsByName( "author" ).get( 3 ); assertNotNull( author ); assertTrue( author.toString().indexOf( "Greater than >" ) > 0 ); assertEquals( "Greater than >", author.getContentAttribute() ); author = (HtmlMeta) page.getHtmlElementsByName( "author" ).get( 4 ); assertNotNull( author ); assertTrue( author.getContentAttribute().equals( "Apostrophe '" ) ); assertEquals( "Apostrophe '", author.getContentAttribute() ); author = (HtmlMeta) page.getHtmlElementsByName( "author" ).get( 5 ); assertNotNull( author ); assertTrue( author.toString().indexOf( "Quote "" ) > 0 ); assertEquals( "Quote \"", author.getContentAttribute() ); author = (HtmlMeta) page.getHtmlElementsByName( "author" ).get( 6 ); assertNotNull( author ); assertTrue( author.toString().indexOf( "test@email.com" ) > 0 ); assertEquals( "test@email.com", author.getContentAttribute() ); author = (HtmlMeta) page.getHtmlElementsByName( "author" ).get( 7 ); assertNotNull( author ); assertTrue( author.toString().indexOf( "test©email.com" ) > 0 ); assertEquals( "test©email.com", author.getContentAttribute() ); HtmlElement element = page.getHtmlElementById( "contentBox" ); assertNotNull( element ); HtmlDivision division = (HtmlDivision) element; assertNotNull( division ); Iterator elementIterator = division.getAllHtmlChildElements(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- HtmlDivision div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "section" ); HtmlHeader2 h2 = (HtmlHeader2) elementIterator.next(); assertNotNull( h2 ); assertEquals( h2.asText().trim(), "section name with entities: '&' '\u0391' ' ' '\uD7ED'" ); HtmlAnchor a = (HtmlAnchor) elementIterator.next(); assertNotNull( a ); assertEquals( a.getAttributeValue( "name" ), "section_name_with_entities:____" ); div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "section" ); div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "section" ); HtmlHeader4 h4 = (HtmlHeader4) elementIterator.next(); assertNotNull( h4 ); assertEquals( h4.asText().trim(), "Entities" ); a = (HtmlAnchor) elementIterator.next(); assertNotNull( a ); assertEquals( a.getAttributeValue( "name" ), "Entities" ); div = (HtmlDivision) elementIterator.next(); HtmlHeader3 h3 = (HtmlHeader3) elementIterator.next(); assertNotNull( h3 ); assertEquals( h3.asText().trim(), "Generic Entities: '&' '<' '>' '\"' '''" ); a = (HtmlAnchor) elementIterator.next(); HtmlParagraph p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "'&' '<' '>' '\"' '''" ); div = (HtmlDivision) elementIterator.next(); h3 = (HtmlHeader3) elementIterator.next(); assertNotNull( h3 ); assertEquals( h3.asText().trim(), "Local Entities: '\u0391' '\u0392' '\u0393' '\uD7ED'" ); a = (HtmlAnchor) elementIterator.next(); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "'\u0391' '\u0392' '\u0393' '\uD7ED\uD7ED' '\u0159\u0159' '\u0159'" ); div = (HtmlDivision) elementIterator.next(); h3 = (HtmlHeader3) elementIterator.next(); assertNotNull( h3 ); assertEquals( h3.asText().trim(), "DTD Entities: ' ' '\u00A1' '\u00A2'" ); a = (HtmlAnchor) elementIterator.next(); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "' ' '\u00A1' '\u00A2'" ); div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "section" ); h4 = (HtmlHeader4) elementIterator.next(); assertNotNull( h4 ); assertEquals( h4.asText().trim(), "CDATA" ); a = (HtmlAnchor) elementIterator.next(); assertNotNull( a ); assertEquals( a.getAttributeValue( "name" ), "CDATA" ); div = (HtmlDivision) elementIterator.next(); assertNotNull( div ); assertEquals( div.getAttributeValue( "class" ), "source" ); HtmlPreformattedText pre = (HtmlPreformattedText) elementIterator.next(); assertNotNull( pre ); assertEquals( pre.asText().trim(), "" ); p = (HtmlParagraph) elementIterator.next(); assertNotNull( p ); assertEquals( p.asText().trim(), "' ' '¡'" ); assertFalse( elementIterator.hasNext() ); } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/HeadVerifier.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/HeadVeri0000644000175000017500000000747211246206576033515 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlLink; import com.gargoylesoftware.htmlunit.html.HtmlMeta; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlStyle; import com.gargoylesoftware.htmlunit.html.HtmlTitle; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; /** * Verify correct rendering of site/xdoc/head.xml. * * @author ltheussl * @version $Id: HeadVerifier.java 809114 2009-08-29 11:14:06Z vsiveton $ */ public class HeadVerifier extends AbstractVerifier { /** {@inheritDoc} */ public void verify( String file ) throws Exception { HtmlPage page = htmlPage( file ); assertNotNull( page ); HtmlElement html = page.getDocumentHtmlElement(); assertNotNull( html ); List tagNames = new ArrayList(); tagNames.add( "head" ); List heads = html.getHtmlElementsByTagNames( tagNames ); assertEquals( 1, heads.size() ); HtmlElement head = (HtmlElement) heads.get( 0 ); assertNotNull( head ); Iterator elementIterator = head.getAllHtmlChildElements(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- HtmlMeta meta = (HtmlMeta) elementIterator.next(); assertEquals( meta.getAttributeValue( "http-equiv" ), "Content-Type" ); assertEquals( meta.getAttributeValue( "content" ), "text/html; charset=UTF-8" ); HtmlTitle title = (HtmlTitle) elementIterator.next(); assertNotNull( title ); HtmlStyle style = (HtmlStyle) elementIterator.next(); assertNotNull( style ); HtmlLink link = (HtmlLink) elementIterator.next(); assertNotNull( link ); meta = (HtmlMeta) elementIterator.next(); assertEquals( meta.getAttributeValue( "name" ), "author" ); assertEquals( meta.getAttributeValue( "content" ).trim(), "John Doe" ); meta = (HtmlMeta) elementIterator.next(); assertEquals( meta.getAttributeValue( "name" ), "Date-Revision-yyyymmdd" ); assertEquals( meta.getAttributeValue( "content" ), new SimpleDateFormat( "yyyyMMdd" ).format( new Date() ) ); meta = (HtmlMeta) elementIterator.next(); assertEquals( meta.getAttributeValue( "http-equiv" ), "Content-Language" ); assertEquals( meta.getAttributeValue( "content" ), "en" ); meta = (HtmlMeta) elementIterator.next(); assertEquals( meta.getAttributeValue( "name" ), "description" ); assertEquals( meta.getAttributeValue( "content" ), "Free Web tutorials" ); meta = (HtmlMeta) elementIterator.next(); assertEquals( meta.getAttributeValue( "name" ), "keywords" ); assertEquals( meta.getAttributeValue( "content" ), "HTML,CSS,XML,JavaScript" ); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootdoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/AbstractVerifier.javadoxia-sitetools-1.1.4/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/Abstract0000644000175000017500000000372611130752271033555 0ustar twernertwernerpackage org.apache.maven.doxia.siterenderer; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; import java.io.File; import org.codehaus.plexus.PlexusTestCase; /** * Abstract base class for verifiers. * * @author ltheussl * @version $Id: AbstractVerifier.java 732140 2009-01-06 22:01:29Z ltheussl $ */ public abstract class AbstractVerifier extends PlexusTestCase { /** * Get a HtmlPage from a file. * * @param htmlFile the file to parse. * * @return a HtmlPage. * * @throws Exception if something goes wrong. */ protected HtmlPage htmlPage( String htmlFile ) throws Exception { File file = getTestFile( htmlFile ); assertNotNull( file ); assertTrue( file.exists() ); // HtmlUnit WebClient webClient = new WebClient(); return (HtmlPage) webClient.getPage( file.toURI().toURL() ); } /** * Verify a HtmlPage. * * @param file the file to verify. * * @throws java.lang.Exception if something goes wrong; */ public abstract void verify( String file ) throws Exception; } doxia-sitetools-1.1.4/doxia-site-renderer/pom.xml0000644000175000017500000001345611470564764022020 0ustar twernertwerner 4.0.0 doxia-sitetools org.apache.maven.doxia 1.1.4 ../pom.xml doxia-site-renderer Doxia Sitetools :: Site Renderer Component The Site Renderer handles the rendering of sites. Vincent Siveton vsiveton@apache.org Apache Software Foundation Java Developer -5 org.apache.maven.doxia doxia-core org.apache.maven.doxia doxia-logging-api org.apache.maven.doxia doxia-sink-api org.apache.maven.doxia doxia-decoration-model org.apache.maven.doxia doxia-module-apt test org.apache.maven.doxia doxia-module-confluence test org.apache.maven.doxia doxia-module-docbook-simple test org.apache.maven.doxia doxia-module-xdoc test org.apache.maven.doxia doxia-module-xhtml org.apache.maven.doxia doxia-module-fml org.codehaus.plexus plexus-i18n org.codehaus.plexus plexus-container-default org.codehaus.plexus plexus-velocity 1.1.7 commons-collections commons-collections org.codehaus.plexus plexus-component-api velocity velocity org.codehaus.plexus plexus-utils org.apache.velocity velocity 1.5 commons-collections commons-collections 3.2 org.apache.maven.doxia doxia-core ${doxiaVersion} test-jar test htmlunit htmlunit 1.13 test reporting org.codehaus.mojo l10n-maven-plugin 1.0-alpha-2 de en es fr it ja nl pl pt_BR zh_CN doxia-sitetools-1.1.4/pom.xml0000644000175000017500000003635411470564764016150 0ustar twernertwerner 4.0.0 org.apache.maven maven-parent 16 ../../pom/maven/pom.xml org.apache.maven.doxia doxia-sitetools 1.1.4 pom Doxia Sitetools Doxia Sitetools generates sites, consisting of static and dynamic content that was generated by Doxia. http://maven.apache.org/doxia/doxia-sitetools 2005 Doxia Developer List doxia-dev@maven.apache.org doxia-dev-subscribe@maven.apache.org doxia-dev-unsubscribe@maven.apache.org http://mail-archives.apache.org/mod_mbox/maven-doxia-dev/ http://www.mail-archive.com/doxia-dev@maven.apache.org http://www.nabble.com/Doxia---dev-f11816.html http://markmail.org/list/org.apache.maven.doxia-dev Doxia User List doxia-users@maven.apache.org doxia-users-subscribe@maven.apache.org doxia-users-unsubscribe@maven.apache.org http://mail-archives.apache.org/mod_mbox/maven-doxia-users/ http://www.mail-archive.com/doxia-users@maven.apache.org http://www.nabble.com/Doxia---Users-f14483.html http://markmail.org/list/org.apache.maven.doxia-users Doxia Commits List doxia-commits-subscribe@maven.apache.org doxia-commits-unsubscribe@maven.apache.org http://mail-archives.apache.org/mod_mbox/maven-doxia-commits/ http://www.mail-archive.com/doxia-commits@maven.apache.org http://markmail.org/list/org.apache.maven.doxia-commits Maven Issues List issues-subscribe@maven.apache.org issues-unsubscribe@maven.apache.org http://mail-archives.apache.org/mod_mbox/maven-issues/ http://www.mail-archive.com/issues@maven.apache.org http://www.nabble.com/Maven---Issues-f15573.html http://markmail.org/list/org.apache.maven.issues 2.0.4 doxia-decoration-model doxia-doc-renderer doxia-site-renderer scm:svn:http://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.1.4 scm:svn:https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.1.4 http://svn.apache.org/viewcvs.cgi/maven/doxia/doxia-sitetools/tags/doxia-sitetools-1.1.4 jira http://jira.codehaus.org/browse/DOXIASITETOOLS apache.website scp://people.apache.org/www/maven.apache.org/doxia/doxia-sitetools ${project.version} 1.1.4 org.apache.maven.doxia doxia-logging-api ${doxiaVersion} org.apache.maven.doxia doxia-sink-api ${doxiaVersion} org.apache.maven.doxia doxia-core ${doxiaVersion} org.apache.maven.doxia doxia-module-apt ${doxiaVersion} org.apache.maven.doxia doxia-module-confluence ${doxiaVersion} org.apache.maven.doxia doxia-module-docbook-simple ${doxiaVersion} org.apache.maven.doxia doxia-module-fml ${doxiaVersion} org.apache.maven.doxia doxia-module-xdoc ${doxiaVersion} org.apache.maven.doxia doxia-module-xhtml ${doxiaVersion} org.apache.maven.doxia doxia-decoration-model ${projectVersion} org.codehaus.plexus plexus-container-default 1.0-alpha-30 org.codehaus.plexus plexus-i18n 1.0-beta-7 org.codehaus.plexus plexus-component-api org.codehaus.plexus plexus-utils 1.5.12 junit junit 3.8.2 test src/main/resources ${project.build.directory}/generated-site/xsd **/*.xsd org.apache.maven.plugins maven-release-plugin https://svn.apache.org/repos/asf/maven/doxia/doxia-sitetools/tags org.codehaus.plexus plexus-maven-plugin 1.3.5 org.codehaus.modello modello-maven-plugin 1.1 org.apache.maven.plugins maven-resources-plugin 2.4.2 org.codehaus.mojo clirr-maven-plugin 2.2.2 1.1 org.apache.maven.plugins maven-javadoc-plugin 2.7 1.4 http://java.sun.com/j2se/1.4.2/docs/api/ http://plexus.codehaus.org/plexus-utils/apidocs/ http://junit.sourceforge.net/javadoc/ org.codehaus.plexus plexus-javadoc 1.0 maven-site-plugin scp://people.apache.org/www/maven.apache.org/doxia/doxia-sitetools-${project.version} org.codehaus.mojo clirr-maven-plugin verify check maven-project-info-reports-plugin 2.1.2 reporting org.apache.maven.plugins maven-javadoc-plugin 1.4 http://java.sun.com/j2se/1.4.2/docs/api/ http://plexus.codehaus.org/plexus-utils/apidocs/ http://junit.sourceforge.net/javadoc/ org.codehaus.plexus plexus-javadoc 1.0 maven-checkstyle-plugin http://svn.apache.org/repos/asf/maven/doxia/doxia/trunk/src/main/resources/config/doxia_checkstyle.xml org.codehaus.mojo clirr-maven-plugin reporting-aggregate org.apache.maven.plugins maven-jxr-plugin true org.apache.maven.plugins maven-javadoc-plugin true 1.4 http://java.sun.com/j2se/1.4.2/docs/api/ http://plexus.codehaus.org/plexus-utils/apidocs/ http://junit.sourceforge.net/javadoc/ org.codehaus.plexus plexus-javadoc 1.0 aggregate test-aggregate m2e target m2e.version ${m2BuildDirectory} org.maven.ide.eclipse lifecycle-mapping 0.10.0 customizable org.apache.maven.plugins:maven-resources-plugin::