SlideShare a Scribd company logo
1 of 11
Download to read offline
XWiki Rendering

Vincent Massol
XWiki Committer
CTO XWiki SAS
!

@vmassol
Vincent Massol, February 2014

27 au 29 mars 2013
What is XWiki Rendering?

•
•
•

A Java, open source (LGPL) library to convert an input in a given syntax
into an output in another syntax.	

Needs: Wikis, Commenting system on web sites, any place where you ask
user to enter content.	

Complex to implement properly!
Supported Syntaxes
Input Syntaxes

•
•
•
•
•
•
•
•
•
•
•

XWiki Syntax 1.0, 2.0, 2.1	

HTML 4.x/XHTML 1.0	

Plain text	

Docbook 4.x	

Confluence/Confluence XHTML	

Mediawiki	

JSPWiki	

TWiki	

Creole 1.0	

Markdown	

APT

Output Syntaxes

•
•
•
•
•

XWiki Syntax 2.0, 2.1	

HTML 4.x/XHTML 1.0	

Plain text	

Docbook 4.x	

APT

Future Syntaxes

•
•

PDF (prototype version using iText exists)	

Asciidoc (need events in Asciidoctor)
Library Initialization

// Initialize Rendering components and allow getting instances!
EmbeddableComponentManager componentManager = !
! new EmbeddableComponentManager();!
componentManager.initialize(this.getClass().getClassLoader());
Example 1: Convert to XHTML
Converter converter =!
! componentManager.getInstance(Converter.class);!
!

WikiPrinter printer = new DefaultWikiPrinter();!
converter.convert(new StringReader("This is **bold**”),!
! Syntax.XWIKI_2_1, Syntax.XHTML_1_0, printer);!
!

Assert.assertEquals("<p>This is <strong>bold</strong></p>", !
! printer.toString());
Example 2: Italicize links
Parser parser = componentManager.getInstance(Parser.class, !
! Syntax.XWIKI_2_1.toIdString());!
XDOM xdom = parser.parse(new StringReader("This a [[link>MyPage]]"));!
!
// Find all links and make them italic!
for (Block block : xdom.getBlocks(new ClassBlockMatcher(LinkBlock.class), !
! Block.Axes.DESCENDANT)) {!
! Block parentBlock = block.getParent();!
! Block newBlock = new FormatBlock(Collections.<Block>singletonList(block), !
! ! Format.ITALIC);!
! parentBlock.replaceChild(newBlock, block);!
}!

!
WikiPrinter printer = new DefaultWikiPrinter();!
BlockRenderer renderer = componentManager.getInstance(BlockRenderer.class, !
! Syntax.XWIKI_2_1.toIdString());!
renderer.render(xdom, printer);!

!
Assert.assertEquals("This a //[[link>MyPage]]//", printer.toString());
Example 3: Execute Macros
Parser parser = componentManager.getInstance(Parser.class, !
! Syntax.XWIKI_2_1.toIdString());!
XDOM xdom = parser.parse(new StringReader("{{id name="test"/}}"));!

!
Transformation transformation = componentManager.getInstance(Transformation.class, !
! "macro");!
TransformationContext txContext = new TransformationContext(xdom, parser.getSyntax());!
transformation.transform(xdom, txContext);!

!
WikiPrinter printer = new DefaultWikiPrinter();!
BlockRenderer renderer = componentManager.getInstance(BlockRenderer.class, !
! Syntax.XHTML_1_0.toIdString());!
renderer.render(xdom, printer);!

!
Assert.assertEquals("<div id="test"></div>", printer.toString());
Demo Time!
!

Build a live preview web site using
XWiki Rendering and AngularJS

27 au 29 mars 2013
Use it!

• Documentation on http://rendering.xwiki.org	

• WYSIWYG editor using XWiki Rendering also available	

• Use Maven for a simple start (recommended) or use the
•

Standalone JAR	

Contribute to add more Syntaxes, more Macros!
Q&A

Me
Vincent Massol

• Speaker Bio	

•

CTO XWiki SAS	


•
•

XWiki (community-driven open source project)	

Past: Maven, Apache Cargo, Apache Cactus, Pattern Testing	


•
•
•

LesCastCodeurs podcast	

Creator of OSSGTP open source group in Paris	

3 books: JUnit in Action, Maven: A Developer’s Notebook, BBWM	


• Your Projects	


• Other Credentials:

More Related Content

More from XWiki

L'intranet collaboratif Aelia : l'étude de cas
L'intranet collaboratif Aelia : l'étude de casL'intranet collaboratif Aelia : l'étude de cas
L'intranet collaboratif Aelia : l'étude de casXWiki
 
An collaborative intranet: the Aelia case study
An collaborative intranet: the Aelia case studyAn collaborative intranet: the Aelia case study
An collaborative intranet: the Aelia case studyXWiki
 
La base de connaissance de la FNAB
La base de connaissance de la FNABLa base de connaissance de la FNAB
La base de connaissance de la FNABXWiki
 
Collaborative Watch: the AFP case study
Collaborative Watch: the AFP case studyCollaborative Watch: the AFP case study
Collaborative Watch: the AFP case studyXWiki
 
Une solution de veille partagée et collaborative : le cas de l'AFP
Une solution de veille partagée et collaborative : le cas de l'AFPUne solution de veille partagée et collaborative : le cas de l'AFP
Une solution de veille partagée et collaborative : le cas de l'AFPXWiki
 
Créer ses applications métier : le cas DCNS
Créer ses applications métier : le cas DCNSCréer ses applications métier : le cas DCNS
Créer ses applications métier : le cas DCNSXWiki
 
La base de connaissances du CNFPT
La base de connaissances du CNFPTLa base de connaissances du CNFPT
La base de connaissances du CNFPTXWiki
 
Documentation of an application revamping program: the Capgemini case study
Documentation of an application revamping program: the Capgemini case studyDocumentation of an application revamping program: the Capgemini case study
Documentation of an application revamping program: the Capgemini case studyXWiki
 
Documentation d'un programme de rénovation applicative : le cas Capgemini
Documentation d'un programme de rénovation applicative : le cas CapgeminiDocumentation d'un programme de rénovation applicative : le cas Capgemini
Documentation d'un programme de rénovation applicative : le cas CapgeminiXWiki
 
Base de connaissance : le cas CAPHC
Base de connaissance : le cas CAPHCBase de connaissance : le cas CAPHC
Base de connaissance : le cas CAPHCXWiki
 
Knowledge Exchange Network: the CAPHC use case
Knowledge Exchange Network: the CAPHC use caseKnowledge Exchange Network: the CAPHC use case
Knowledge Exchange Network: the CAPHC use caseXWiki
 
La plateforme IWA : retour d'expérience
La plateforme IWA : retour d'expérienceLa plateforme IWA : retour d'expérience
La plateforme IWA : retour d'expérienceXWiki
 
How DCNS creates its own business applications
How DCNS creates its own business applicationsHow DCNS creates its own business applications
How DCNS creates its own business applicationsXWiki
 
Ressources pédagogiques en ligne
Ressources pédagogiques en ligneRessources pédagogiques en ligne
Ressources pédagogiques en ligneXWiki
 
L'intranet collaboratif Fidelia Assistance
L'intranet collaboratif Fidelia AssistanceL'intranet collaboratif Fidelia Assistance
L'intranet collaboratif Fidelia AssistanceXWiki
 
Documentation produit : le cas Easyvista
Documentation produit : le cas EasyvistaDocumentation produit : le cas Easyvista
Documentation produit : le cas EasyvistaXWiki
 
Documentation and Knowledge management: the EasyVista's use case
Documentation and Knowledge management: the EasyVista's use caseDocumentation and Knowledge management: the EasyVista's use case
Documentation and Knowledge management: the EasyVista's use caseXWiki
 
Collaborative intranet: the Fidelia Assistance case study
Collaborative intranet: the Fidelia Assistance case studyCollaborative intranet: the Fidelia Assistance case study
Collaborative intranet: the Fidelia Assistance case studyXWiki
 
L'intranet Numéricable / SFR
L'intranet Numéricable / SFRL'intranet Numéricable / SFR
L'intranet Numéricable / SFRXWiki
 
La mise en place d'un centre de ressources : le cas XWiki / FOPH
La mise en place d'un centre de ressources : le cas XWiki / FOPHLa mise en place d'un centre de ressources : le cas XWiki / FOPH
La mise en place d'un centre de ressources : le cas XWiki / FOPHXWiki
 

More from XWiki (20)

L'intranet collaboratif Aelia : l'étude de cas
L'intranet collaboratif Aelia : l'étude de casL'intranet collaboratif Aelia : l'étude de cas
L'intranet collaboratif Aelia : l'étude de cas
 
An collaborative intranet: the Aelia case study
An collaborative intranet: the Aelia case studyAn collaborative intranet: the Aelia case study
An collaborative intranet: the Aelia case study
 
La base de connaissance de la FNAB
La base de connaissance de la FNABLa base de connaissance de la FNAB
La base de connaissance de la FNAB
 
Collaborative Watch: the AFP case study
Collaborative Watch: the AFP case studyCollaborative Watch: the AFP case study
Collaborative Watch: the AFP case study
 
Une solution de veille partagée et collaborative : le cas de l'AFP
Une solution de veille partagée et collaborative : le cas de l'AFPUne solution de veille partagée et collaborative : le cas de l'AFP
Une solution de veille partagée et collaborative : le cas de l'AFP
 
Créer ses applications métier : le cas DCNS
Créer ses applications métier : le cas DCNSCréer ses applications métier : le cas DCNS
Créer ses applications métier : le cas DCNS
 
La base de connaissances du CNFPT
La base de connaissances du CNFPTLa base de connaissances du CNFPT
La base de connaissances du CNFPT
 
Documentation of an application revamping program: the Capgemini case study
Documentation of an application revamping program: the Capgemini case studyDocumentation of an application revamping program: the Capgemini case study
Documentation of an application revamping program: the Capgemini case study
 
Documentation d'un programme de rénovation applicative : le cas Capgemini
Documentation d'un programme de rénovation applicative : le cas CapgeminiDocumentation d'un programme de rénovation applicative : le cas Capgemini
Documentation d'un programme de rénovation applicative : le cas Capgemini
 
Base de connaissance : le cas CAPHC
Base de connaissance : le cas CAPHCBase de connaissance : le cas CAPHC
Base de connaissance : le cas CAPHC
 
Knowledge Exchange Network: the CAPHC use case
Knowledge Exchange Network: the CAPHC use caseKnowledge Exchange Network: the CAPHC use case
Knowledge Exchange Network: the CAPHC use case
 
La plateforme IWA : retour d'expérience
La plateforme IWA : retour d'expérienceLa plateforme IWA : retour d'expérience
La plateforme IWA : retour d'expérience
 
How DCNS creates its own business applications
How DCNS creates its own business applicationsHow DCNS creates its own business applications
How DCNS creates its own business applications
 
Ressources pédagogiques en ligne
Ressources pédagogiques en ligneRessources pédagogiques en ligne
Ressources pédagogiques en ligne
 
L'intranet collaboratif Fidelia Assistance
L'intranet collaboratif Fidelia AssistanceL'intranet collaboratif Fidelia Assistance
L'intranet collaboratif Fidelia Assistance
 
Documentation produit : le cas Easyvista
Documentation produit : le cas EasyvistaDocumentation produit : le cas Easyvista
Documentation produit : le cas Easyvista
 
Documentation and Knowledge management: the EasyVista's use case
Documentation and Knowledge management: the EasyVista's use caseDocumentation and Knowledge management: the EasyVista's use case
Documentation and Knowledge management: the EasyVista's use case
 
Collaborative intranet: the Fidelia Assistance case study
Collaborative intranet: the Fidelia Assistance case studyCollaborative intranet: the Fidelia Assistance case study
Collaborative intranet: the Fidelia Assistance case study
 
L'intranet Numéricable / SFR
L'intranet Numéricable / SFRL'intranet Numéricable / SFR
L'intranet Numéricable / SFR
 
La mise en place d'un centre de ressources : le cas XWiki / FOPH
La mise en place d'un centre de ressources : le cas XWiki / FOPHLa mise en place d'un centre de ressources : le cas XWiki / FOPH
La mise en place d'un centre de ressources : le cas XWiki / FOPH
 

Recently uploaded

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Recently uploaded (20)

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

XWiki Rendering: A content rendering engine

  • 1. XWiki Rendering Vincent Massol XWiki Committer CTO XWiki SAS ! @vmassol Vincent Massol, February 2014 27 au 29 mars 2013
  • 2. What is XWiki Rendering? • • • A Java, open source (LGPL) library to convert an input in a given syntax into an output in another syntax. Needs: Wikis, Commenting system on web sites, any place where you ask user to enter content. Complex to implement properly!
  • 3. Supported Syntaxes Input Syntaxes • • • • • • • • • • • XWiki Syntax 1.0, 2.0, 2.1 HTML 4.x/XHTML 1.0 Plain text Docbook 4.x Confluence/Confluence XHTML Mediawiki JSPWiki TWiki Creole 1.0 Markdown APT Output Syntaxes • • • • • XWiki Syntax 2.0, 2.1 HTML 4.x/XHTML 1.0 Plain text Docbook 4.x APT Future Syntaxes • • PDF (prototype version using iText exists) Asciidoc (need events in Asciidoctor)
  • 4. Library Initialization // Initialize Rendering components and allow getting instances! EmbeddableComponentManager componentManager = ! ! new EmbeddableComponentManager();! componentManager.initialize(this.getClass().getClassLoader());
  • 5. Example 1: Convert to XHTML Converter converter =! ! componentManager.getInstance(Converter.class);! ! WikiPrinter printer = new DefaultWikiPrinter();! converter.convert(new StringReader("This is **bold**”),! ! Syntax.XWIKI_2_1, Syntax.XHTML_1_0, printer);! ! Assert.assertEquals("<p>This is <strong>bold</strong></p>", ! ! printer.toString());
  • 6. Example 2: Italicize links Parser parser = componentManager.getInstance(Parser.class, ! ! Syntax.XWIKI_2_1.toIdString());! XDOM xdom = parser.parse(new StringReader("This a [[link>MyPage]]"));! ! // Find all links and make them italic! for (Block block : xdom.getBlocks(new ClassBlockMatcher(LinkBlock.class), ! ! Block.Axes.DESCENDANT)) {! ! Block parentBlock = block.getParent();! ! Block newBlock = new FormatBlock(Collections.<Block>singletonList(block), ! ! ! Format.ITALIC);! ! parentBlock.replaceChild(newBlock, block);! }! ! WikiPrinter printer = new DefaultWikiPrinter();! BlockRenderer renderer = componentManager.getInstance(BlockRenderer.class, ! ! Syntax.XWIKI_2_1.toIdString());! renderer.render(xdom, printer);! ! Assert.assertEquals("This a //[[link>MyPage]]//", printer.toString());
  • 7. Example 3: Execute Macros Parser parser = componentManager.getInstance(Parser.class, ! ! Syntax.XWIKI_2_1.toIdString());! XDOM xdom = parser.parse(new StringReader("{{id name="test"/}}"));! ! Transformation transformation = componentManager.getInstance(Transformation.class, ! ! "macro");! TransformationContext txContext = new TransformationContext(xdom, parser.getSyntax());! transformation.transform(xdom, txContext);! ! WikiPrinter printer = new DefaultWikiPrinter();! BlockRenderer renderer = componentManager.getInstance(BlockRenderer.class, ! ! Syntax.XHTML_1_0.toIdString());! renderer.render(xdom, printer);! ! Assert.assertEquals("<div id="test"></div>", printer.toString());
  • 8. Demo Time! ! Build a live preview web site using XWiki Rendering and AngularJS 27 au 29 mars 2013
  • 9. Use it! • Documentation on http://rendering.xwiki.org • WYSIWYG editor using XWiki Rendering also available • Use Maven for a simple start (recommended) or use the • Standalone JAR Contribute to add more Syntaxes, more Macros!
  • 11. Vincent Massol • Speaker Bio • CTO XWiki SAS • • XWiki (community-driven open source project) Past: Maven, Apache Cargo, Apache Cactus, Pattern Testing • • • LesCastCodeurs podcast Creator of OSSGTP open source group in Paris 3 books: JUnit in Action, Maven: A Developer’s Notebook, BBWM • Your Projects • Other Credentials: