From mfortun@users.nuiton.org Mon Aug 29 23:31:02 2011 From: mfortun@users.nuiton.org To: wikitty-commits@list.nuiton.org Subject: [Wikitty-commits] r1200 - in trunk/wikitty-publication/src: main/resources/filters-properties site/doc Date: Mon, 29 Aug 2011 23:31:02 +0200 Message-ID: <20110829213102.2EDB25A57D@nuiton.codelutin.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6662888970332645871==" --===============6662888970332645871== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: mfortun Date: 2011-08-29 23:31:02 +0200 (Mon, 29 Aug 2011) New Revision: 1200 Url: http://nuiton.org/repositories/revision/wikitty/1200 Log: correct/complete docs Modified: trunk/wikitty-publication/src/main/resources/filters-properties/README.txt trunk/wikitty-publication/src/site/doc/Rajouter_des_langages.rst Modified: trunk/wikitty-publication/src/main/resources/filters-properties/REA= DME.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/wikitty-publication/src/main/resources/filters-properties/README.tx= t 2011-08-29 15:44:02 UTC (rev 1199) +++ trunk/wikitty-publication/src/main/resources/filters-properties/README.tx= t 2011-08-29 21:31:02 UTC (rev 1200) @@ -1,12 +1,11 @@ - - - Those filters options are use to transform WikittyPubText content with a nuiton processor and filters. The goal of this is to include html (and after other langage design for ui inside web browser) with scripting mechanism.=20 Instead of write the script and include inside result value html tag, do the= =20 opposite, that what allow those filters. +In this case use script langage inside tag like in a jsp: <% %> and <%=3D %> =20 + Filters options doc: =20 OpeningTemplate: the string openning the template @@ -34,14 +33,13 @@ with template: =20 -wpContext.setContentType("[ContentType]"); +wpContext.setContentType("[ContentType]")[EndingCar] =20 -[OpeningTemplate][StringDelim]; -var name=3D bob; -[WriteString][OpeningWriterChar][StringDelim]

Hello World [StringDelim][C= oncatChar]name[ConcatChar]!

[ConcatChar][StringDelim]; - -[WriteString][OpeningWriterChar][StringDelim][StringDelim]; - +[OpeningTemplate][StringDelim][ClosingWriterChar][EndingCar]=09 +[WriteString][OpeningWriterChar][StringDelim]bob[StringDelim][ClosingWriterC= har][EndingCar] +[WriteString][OpeningWriterChar][StringDelim]

Hello World [StringDelim][C= oncatChar]name[ConcatChar][StringDelim]!

[StringDelim][ClosingWriterChar]= [EndingCar] +[WriteString][OpeningWriterChar][StringDelim][StringDelim][ClosingWri= terChar][EndingCar][ClosingTemplate] +=09 This filters will be enable when try to evaluate wikittyPubText with mime ty= pe: text/[Key], the mime type of the wikittyPubText after will be: [MimeType] =20 @@ -60,3 +58,16 @@ This filters will be enable when try to evaluate wikittyPubText with mime ty= pe: text/html.javascript, the mime type of the wikittyPubText after will be: app= lication/javascript =20 +Template: + +OpeningTemplate=3D +WriteString=3D +StringDelim=3D +ConcatChar=3D +EndingCar=3D +ClosingWriterChar=3D +OpeningWriterChar=3D +ClosingTemplate=3D +MimeType=3D +Key=3D +ContentType=3D Modified: trunk/wikitty-publication/src/site/doc/Rajouter_des_langages.rst =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/wikitty-publication/src/site/doc/Rajouter_des_langages.rst 2011-08-= 29 15:44:02 UTC (rev 1199) +++ trunk/wikitty-publication/src/site/doc/Rajouter_des_langages.rst 2011-08-= 29 21:31:02 UTC (rev 1200) @@ -1,12 +1,95 @@ -Fonctionnement des mime type +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D +Comment rajouter des langages dans Wikitty Publication +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D +:Authors: Mano=C3=ABl Fortun =20 +Un nouveau langage +------------------ =20 +Pour rajouter un nouveau langage il faut enregistrer dans le service ou dans= =20 +le classPath le jar contenant le script engine correspondant. Il faut s'assu= rer +que l'engine peut =C3=AAtre r=C3=A9cup=C3=A9r=C3=A9 avec un mimeType de form= e : text/[langage], avec +langage qui est =C3=A9gale au langage de script. Puisque la forme text/[truc= ] correspond +qu wikitty pub text dans le mapping des mimeType. =20 -Rajouter des langages =20 +Comment marche le mapping mimeType <-> extension de fichier +----------------------------------------------------------- =20 -Rajouter le m=C3=A9canisme des mime type extension +Dans les ressources du module Wikitty Publication il y a un fichier de propr= i=C3=A9t=C3=A9s +nomm=C3=A9: "mimetype.properties" qui contient les mapping mimeType <-> exte= nsion. +Seulement ceux =C3=A0 l'int=C3=A9rieur sont consid=C3=A9r=C3=A9. =20 +Pour en rajouter il suffit de rajouter des lignes. =20 -Jouer avec la d=C3=A9coration +Les mimeTypes commen=C3=A7ant par text/ seront consid=C3=A9r=C3=A9s comme de= s wikittyPubText. +Les mimeTypes compos=C3=A9 comme:=20 +text/html.javascript=3Dhtmljs +Sont des mimeTypes li=C3=A9s au filtres: =20 +Comment marche les filtres +-------------------------- + +Les filtres sont =C3=A0 utiliser en relation avec le mapping mime type - ext= ension. +Ils permettent de d=C3=A9finir des transformations du contenu d'un wikitty p= ub text. +Ceci est utilis=C3=A9 par exemple pour ins=C3=A9rer du html dans le contenu = des wikitty +pub text facilement, ou d'autre. + +Pour en rajouter il suffit de reprendre le template et de le remplir selon +ses besoins. + +Les Options de fitre: +********************* + + * OpeningTemplate: chaine d'ouverture du template + * WriteString: instruction d'=C3=A9criture=20 + * StringDelim: d=C3=A9limiteur de chaine exemple " + * ConcatChar: caract=C3=A8re de concat=C3=A9nation + * EndingCar: caract=C3=A8re de fin d'instruction + * ClosingWriterChar: chaine qui se place avant le caract=C3=A8re de fin et = le d=C3=A9limiteur de chaine + * OpeningWriterChar: chaine qui se place juste apr=C3=A8s l'instruction d'= =C3=A9criture et avant le d=C3=A9limiteur de chaine + * ClosingTemplate: chaine de fermeture du template + * MimeType: mime type apr=C3=A8s application du template + * Key: cl=C3=A9 du mime type, d=C3=A9finition des langages utilis=C3=A9 lan= gageAutourBalise.LangageEntreBalise si le mime type du wikitty pub fini par l= a cl=C3=A9, ce template sera appliqu=C3=A9. + * ContentType: content type qui sera mit pour le retour de la page +=20 + +Un exemple de fonctionnement +**************************** + +Contenu d'un wikitty pub text: +=09 + =20 + <%var name=3D"bob"%> =20 +

Hello World <%=3Dname%>!

=20 + =20 + +R=C3=A8gle de remplacement avec le template: + + wpContext.setContentType("[ContentType]")[EndingCar] = =20 + = =20 + [OpeningTemplate][StringDelim][ClosingWriterChar][EndingCar] + + [WriteString][OpeningWriterChar][StringDelim]bob[StringDelim][ClosingWriter= Char][EndingCar] + + [WriteString][OpeningWriterChar][StringDelim]

Hello World [StringDelim][= ConcatChar]name[ConcatChar][StringDelim]!

[StringDelim][ClosingWriterChar= ][EndingCar] + + [WriteString][OpeningWriterChar][StringDelim][StringDelim][ClosingWr= iterChar][EndingCar][ClosingTemplate] + +ce filtre sera actif quand on le mime type du wikittyPubText sera : +text/[Key], apr=C3=A8s transformation par le filtre le mimetype sera [MimeTy= pe] + +Si on avait utilis=C3=A9 le filtre de base: + + wpContext.setContentType("text/html; charset=3DUTF-8"); =20 + =20 + var wp_result=3D""; =20 + var name=3D bob; =20 + wp_result+=3D"

Hello World "+name+"!

"; = =20 + wp_result+=3D""; =20 + + +ce filtre sera actif quand on le mime type du wikittyPubText sera : +text/html.javascript, apr=C3=A8s transformation par le filtre le mimetype se= ra application/javascript + + --===============6662888970332645871==--